Advertisement
Guest User

Untitled

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