Created
February 2, 2012 15:09
-
-
Save siwells/1723895 to your computer and use it in GitHub Desktop.
Pipeline to inspect octal permissions of a file in a cross-platform (GNU & BSD Userland) fashion
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
| ls -l $file | awk '{ print $1 }' | colrm 1 1 | sed -e 's/@$//' | sed -e 's/--x/1/g' -e 's/-w-/2/g' -e 's/-wx/3/g' -e 's/r--/4/g' -e 's/r-x/5/g' -e 's/rw-/6/g' -e 's/rwx/7/g' -e 's/---/0/g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment