[X-Unix] Recursive one-line chmod
Phillip Burk
philburk at mac.com
Wed Sep 21 09:09:12 PDT 2005
Alright, I'm trying to use ARD to issue a one-line command that will
step through all the directories in /Users and assign recursive
proper ownership. I don't care if it errors on the Shared folder, I
have a login hook to blast that to 777. I have no clue as to the
proper syntax of the thing although if I were using a script to do
this I imagine it would use a foreach command to parse the usernames
from the individual directories themselves and then assign ownership
based on that username.
Kinda like this:
Foreach directory in /Users
assign name to $username
if $username=="Shared" then next
endif
chown -R $username:admin /Users/$username
or something like that. I'm not a programmer, heck, I'm not even a
shell-scripter. I just need a little push with the syntax. If I
have to push and run a script remotely to do this I'll do that.
Thanks.
More information about the X-Unix
mailing list