Guest User

Untitled

a guest
Jul 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. read -ep 'please enter a filename: ' filename
  4.  
  5. if [ -f "$filename" ]; then
  6.   echo 'This is a regular file.'
  7. else
  8.   echo 'This is not a regular file.'
  9. fi
  10.  
  11. if [ -O "$filename" ]; then
  12.   echo 'This file is owned by the effective user ID.'
  13. else
  14.   echo 'This file is not owned by the effective user ID.'
  15. fi
  16.  
  17. if [ -w "$filename" ]; then
  18.   echo 'This file is writable.'
  19. else
  20.   echo 'This file is made writable for all users now.'
  21.   chmod o+w "$1"
  22. fi
Add Comment
Please, Sign In to add comment