Skip to content

Instantly share code, notes, and snippets.

@mpitt
Created April 9, 2013 16:26
Show Gist options
  • Save mpitt/5347142 to your computer and use it in GitHub Desktop.
Save mpitt/5347142 to your computer and use it in GitHub Desktop.
stat --version &>/dev/null
if [[ $! ]]; then
p=$(stat -c %a $1)
u=$(stat -c %U $1)
g=$(stat -c %G $1)
else
p=$(stat -f %p $1)
u=$(stat -f %Su $1)
g=$(stat -f %Sg $1)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment