Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- otipo=$(ls -l | grep "$@$" | cut -c 1,4)
- if test "otipo" = ""
- then
- echo "$@ -> doesn't exist!"
- else
- if test "${otipo:0:1}" = "d"
- then
- echo "$@ -> is a directory!"
- else
- if test "${otipo:1:2}" = "x"
- then
- echo "$@ -> is an executable file!"
- else
- echo "$@ -> is a text file!"
- fi
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement