Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 #!/bin/bash
- 2
- 3 # Checks if the file given as a command line argument is executable or writeable.
- 4
- 5 if [ -w $1 ] && [ -x $1 ]
- 6 then
- 7 echo Your file is both writeable and executable
- 8 elif [ -w $1 ]
- 9 then
- 10 echo Your file is writeable
- 11 elif [ -x $1 ]
- 12 then
- 13 echo Your file is executable
- 14 fi
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement