howto execute for loop on remote mach using shell script
Hi,
I want a for loop to be executed on a remote machine using ssh. For that I wrote a script but Im not able to execute the for loop. Some errors are coming.. Would like to have your suggestions #!/bin/sh x=`ssh 192.168.10.91 " cd /home/danish/scp/ FILES=`ls -l` for FILE in $FILES do > "$FILE.copy" done "` #./scpremotefiles1.sh ./scpremotefiles1.sh: command substitution: line 10: unexpected EOF while looking for matching `"' ./scpremotefiles1.sh: command substitution: line 11: syntax error: unexpected end of file ./scpremotefiles1.sh: command substitution: line 5: unexpected EOF while looking for matching `"' ./scpremotefiles1.sh: command substitution: line 7: syntax error: unexpected end of file ./scpremotefiles1.sh: line 5: -l: command not found Thanks Danish |
You're missing a quote somewhere. By the looks of it in the line where you connect (single quote and double quote).
|
All times are GMT -5. The time now is 06:15 PM. |