June 17, 2006
Shell Script For Copying Files
Here’s a simple shell script for copying a file to all the accounts on the same server. Of course, this can be modified to do just about anything.
#!/bin/sh
accounts=”usernam1 usernam2 usernam3 usernam4″
for account in $accounts
do
cp htaccess.txt /home/$account/public_html/.htaccess
done
In this example accounts is an array of usernames which gets assigned to the variable $account while looping through the accounts array. This script copies a file called htaccess.txt to .htaccess in each users account. Fast.
Filed under Web by admin.




























