I have about 50 users in /home
I want to create a cron job for each user that will run sa-learn on a spam
file. I have it properly setup for my user, but I want to copy that to each
other user, then use sed to replace my user name in each file with the proper
user name.
I did this
for user in '/bin/ls /home'; do
cp /var/spool/cron/nengland /var/spool/cron/$user
sed -i 's/nengland/$user/' $user
chown $user $user
done
While it worked, instead of replacing nengland with the username, it literally
replaced it with '$user'
What is the proper way to do this?
Nathan
--
~~~~~~~~~~~~~~~~~~
Nathan England
PaysonLinux User Group
nathan@paysonlinux.org
http://www.paysonlinux.org/
Software Development
Website Development
Linux Administration
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss