Advertisement
Guest User

It's a dir?

a guest
May 12th, 2012
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Inserta el nombre del archivo"
  3. read file
  4. if [ -e $file ];
  5. then
  6. if [ -f $file ];
  7. then
  8. echo "Es un archivo"
  9. sleep 3
  10. else
  11. echo "Es un directorio"
  12. sleep 3
  13. fi
  14. else
  15. echo "No existe ningun directorio ni archivo con ese nombre"
  16. sleep 3
  17. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement