« Reply #21 on: October 03, 2008, 09:16:33 AM »
Cactus,
Thank you for helping but this script gets the username as "./user" instead of "user"
here is an explanation :
pushd /home/e-smith/files/users/; \
for u in `find -maxdepth 1 -type d`; \
do \
echo $u
done; \
popd
that gives :
So when i try
pushd /home/e-smith/files/users/; \
for u in `find -maxdepth 1 -type d`; \
do \
mkdir -p $u/Maildir/.LearnAsHam/{cur,new,tmp}; \
chown -R $u:$u $u/Maildir/.LearnAsHam/; \
mkdir -p $u/Maildir/.LearnAsSpam/{cur,new,tmp}; \
chown -R $u:$u $u/Maildir/.LearnAsSpam/; \
mkdir -p $u/Maildir/.LearnInWL/{cur,new,tmp}; \
chown -R $u:$u $u/Maildir/.LearnInWL/; \
done; \
popd
I get
Have a look at
my post again, I almost immediately modified it as I noticed this problem as well. The current version above should not have this issue, furthermore the others should have the proper ownership now, the difference is that the new version does only lists real directories where the find command would also insert the '.' and the './' before, the version with ls should work properly.
« Last Edit: October 03, 2008, 09:20:08 AM by cactus »
Logged
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)