[K12OSN] Script Help Needed!!---further clarification
"Terrell Prudé, Jr."
microman at cmosnetworks.com
Tue Jul 13 02:46:32 UTC 2004
Caleb Wagnon wrote:
>I mean we need to get /home/username/smbhome contents moved to the root of the
>users home directory...not /home in general
>
>
How about something like this:
#!/bin/bash
# This script assumes, in true ugly hack fashion, that only actual users
# will actually have directories under /home. However, if there's, say,
# a /home/ftp that doesn't have a smbhome/ subdir in it, it'll just throw
# up an error message and keep going to the next one (say, /home/greg).
for user in `ls -C1 /home`
do
mv /home/$user/smbhome/* /home/$user/
done
More information about the K12OSN
mailing list