[LIP] bash variable expansion
Amit Kucheria <[email protected]>
| Newsgroups | gmane.user-groups.linux.india.programmers |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have a small script below to copy a set of files to a set of machines
on the network. I can't figure out how to enable tilde expansion for the
first instance of 'fname' in the script even after RTFMing the bash
manpage. Any help is appreciated.
TIA.
/Amit
-------------
#!/bin/sh -x
# Script to copy certain files to all the testbed machines
MACHINES="w2 w3 w4 b1 b2"
FILES="~/.bashrc ~/.bash_profile"
for name in $MACHINES;
do
for fname in $FILES;
do
scp -oUser=root $fname $name:$fname;
done
done
-------------
--
I'm an angel!!! Honest!
The horns are just there to hold the halo up straight.
-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl