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

RE: [cobalt-users] cp recursive command ?



<snip>
> Now my question : How can i make to copy my modified 
> /etc/skel/.ftphelp file
> on EVERY users's .ftphelp file ???
> I have a server with over 300 users, and really don't want to 
> edit every
> user with pico ;)
> Thanks to show us also the command to preserve the owner and the
> permissions.
</snip>

What about a bit of /bin/bash'ery ;)

#!/bin/sh

FILESTOFIX=`cd /home/sites;find |grep .ftphelp`

for i in $FILESTOFIX; do
	echo "Line1" > $i
	echo "Line2" >> $i
done
echo "All done!"



Hope that helps, i did a quick test here and worked fine, but TEST IT FIRST!!!!
Have a good weekend all!
Regards,

Andy
andy@xxxxxxxxxx
http://www.raqpak.com/ <-- Raq/Qube unofficial PKGs and support advice