On Monday 16 December 2002 12:54 am, Elky Grrrr... wrote:
> hi i have a /home/samba folder that holds the samba
> user's home directories, ok, so for some reason the
> owner of each directory is "stto" and is in the group
> "users". there are about a hundred directories!!
> dont ask me how it happened... the admin must be
> smoking weed again!!! now, i could always do "chown
> -R daustria.users daustria", but i have to do it on
> all the folders one by one!! how can i change it all
> using bash? or perl?
are the directories named after the users? i.e., is
daustria's directory named daustria? if yes, and if
there are no spaces in any directory name [ see previous
discussions :]
cd /home/samba
for fn in `ls`
do
if [ -d $fn ]
then
chown -R $fn.users $fn
fi
done
that assumes that all directories are user directories with the
same name as the user. if that's not the case, don't do the
above.
if it's the case for almost all of them, do the above, and then
fix the exceptions.
if you're paranoid (and you *should* be), do a:
cd /home
tar cvzf samba.tgz samba
first :).
tiger
--
Gerald Timothy Quimpo tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
Pobrecito mexico tan lejos de Dios y a la vez
tan cerca de los Estados Unidos
Gen. Porfirio Diaz
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]