LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-22-2006, 03:22 AM   #1
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
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
 
Old 08-22-2006, 04:07 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
You're missing a quote somewhere. By the looks of it in the line where you connect (single quote and double quote).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
execute custom made script on startup howto ALInux Linux - General 7 02-07-2006 02:25 PM
shell script - while loop with multiple conditions ronsha Programming 13 12-10-2005 05:08 PM
Problem with simple shell script for loop abefroman Programming 2 10-25-2005 09:26 PM
shell script won't execute brandnewbie Linux - Newbie 7 08-10-2004 02:30 PM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 07:24 PM


All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration