Bob Miller wrote:
Patrick R. Wade wrote:
My problem ; i have a file containing a list of filenames, which may
contain spaces or dots in them:
---
foo
bar baz
quux.random
---
I would like to execute a series of scp commands on them:
---
scp [EMAIL PROTECTED]:foo here/
scp "[EMAIL PROTECTED]:bar baz" here/
scp [EMAIL PROTECTED]:quux.random here/
---
#!/bin/sh
while IFS="
" read word
do
echo scp ">>>[EMAIL PROTECTED]:$word<<<" here/
done <<EOF
foo
bar baz
quux.random
EOF
Up at the top it reads ... I F S = " \n " ... And the >>> <<< are
just showing where that particular arg starts and stops.
Bob Miller
I was able to get this one to work by removing the 'echo', and adding \"
in four places (see below) - granted my testing was all local. Does it
behave differently copying from remote?
Regards
Fred James
#!/bin/sh
#
while IFS="
" read word
do
scp "\"$word\"" ./\""$word\"".new
foo
bar baz
quux.random
EOF
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug