Created
January 11, 2014 22:02
-
-
Save coderofsalvation/8377555 to your computer and use it in GitHub Desktop.
checks if given file/path is writable
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
| # checks if given file/path is writable | |
| # @param string filename | |
| # usage: is_writable my/path/foo.txt || echo "not writable" | |
| is_writable(){ | |
| [[ -w "$1" ]] && return 0 || return 1 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment