Help !!!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help !!!!
# 1  
Old 04-17-2008
Help !!!!

Code:
perms=`ls -l "$1" | cut -f1`
perms=${perms#?}
for role in user group other; do
  what=none
  case $perms in
    r??*) what=read;;
  esac
  case $perms in
    ?w?*) what="$what"${what:+", "}"write";;
  esac
  case $perms in
    ??x*) what="$what"${what:+", "}"execute";;
  esac
  echo "$what for $role"
  perms=${perms#???}
done

this works for a file. How do you change it for a directory???SmilieSmilieSmilieSmilieSmilie

Last edited by Yogesh Sawant; 04-18-2008 at 01:31 AM.. Reason: added code tags
# 2  
Old 04-18-2008
Use ls -ld

Maybe try to come up with a more specific topic for new threads; people are more inclined to read something with a good label on it.
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question