Originally posted by Mithras:
Huh, something similar works fine for me
Code:
#!/bin/sh
chown -R $1:$2 /Users/Shared
chmod -R 755 /Users/Shared
You sure the group names that you're entering work fine? Have you tried entering the command by hand to confirm it works as expected on the command line?
e.g.
[user@host ~/testing] new_u = someuser
[user@host ~/testing] new_g = somegroup
[user@host ~/testing] chown -R $new_u:$new_g /Homes/$new_u
?
Were you using legit users and groups? I just figured it out I think. I was testing it with a fake user, for who I made a folder in
/Homes/, but he did not have an account on the system.
Before I decided to write the script I tested on a legit user (with a legit group) by just issuing the chown and chmod commands manually. Then I wrote that script thinking that it should work fine. From your suggestion I tried the command by just using
chown someuser:somegroup, and of course it failed. Then I tried for a legit user and group and it worked. Here's what happened...
The users for whose home folders I was trying to manipulate do not have local accounts, they are in a Mac OS X server directory. While I was playing with permissions in the Get Info window none of the pulldown menus listed any of these users or groups. This made sense to me as they are no local accounts so they should not be showing up. I thought Mac OS X Server was behaving as it should but I guess I was wrong, the OS knows about those users in the LDAP database too. So I assume that once I give it a try again everything will be ok.
Thanks for pointing me in the right direction
