Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- read -ep 'please enter a filename: ' filename
- if [ -f "$filename" ]; then
- echo 'This is a regular file.'
- else
- echo 'This is not a regular file.'
- fi
- if [ -O "$filename" ]; then
- echo 'This file is owned by the effective user ID.'
- else
- echo 'This file is not owned by the effective user ID.'
- fi
- if [ -w "$filename" ]; then
- echo 'This file is writable.'
- else
- echo 'This file is made writable for all users now.'
- chmod o+w "$1"
- fi
Add Comment
Please, Sign In to add comment