Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jamincollins
Created January 10, 2017 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamincollins/f383303b1efb4ba23fd63816ba7d9354 to your computer and use it in GitHub Desktop.
Save jamincollins/f383303b1efb4ba23fd63816ba7d9354 to your computer and use it in GitHub Desktop.
#!/bin/bash
check_permissions() {
TGT=${1}
if [ -L ${TGT} ]; then
echo -n "${TGT} -> "
TGT=$(readlink -f ${TGT})
echo "${TGT}"
fi
echo $(stat -c "%A %U:%G" ${TGT}) ${TGT}
if [ "/" != ${TGT} ]; then
check_permissions $(dirname ${TGT})
fi
}
check_permissions $(readlink -f ${1})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment