[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[K12OSN] Re: chown script help needed (word of caution) -THANKS

Michael wrote:

> version 0.3:
> awk -F: '$3>500 {print $3, $4, $6}' /etc/passwd | while read u g h
> do
>    chown -R $u:$g "$h"
> done
> This last one avoids the assumption that the primary group name is
> the same as the username (though that will almost always be true). It
> uses the name of the home directory directly from the password file
> rather than trying to constructing it on the fly (it also works with
> home dirs with spaces in the name).
> I also suggest running pwck first to check the consistency of the
> password file.

Dear Quentin and Michael,

Thanks for the tips.  It's exchanges like yours that provide wonderful gems for those of us who don't know so much about what we're doing.  I've filed that one away for the day that I screw up /home.

Jimmy Schwankl


Q: Why did the chicken cross the Moebius strip?
A: To get to the other ... er, um ... 
****This Message was sent through the Chatham County Schools E-Mail Server****

All e-mail correspondence to and from this address is subject to the
North Carolina Public Records Law, which may result in monitoring and
disclosure to third parties, including law enforcement.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]