Created
May 9, 2018 15:32
-
-
Save classmember/dc232342ac61971442f191d6d42cf094 to your computer and use it in GitHub Desktop.
file_perms_eq.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # function: file_perms_eq | |
| # description: checks first option (filename) to see if the file perms equals the second option (permissions) | |
| # usage example: | |
| # $ if file_perms_eq mail 700 | |
| # > then echo 'good' | |
| # > fi | |
| file_perms_eq() { (( $(stat -c "%a" $1) == $2 ));} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment