Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-22-2006, 02:22 AM   #1
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
howto execute for loop on remote mach using shell script

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


x=`ssh " cd /home/danish/scp/
FILES=`ls -l`
for FILE in $FILES
> "$FILE.copy"
done "`

./ command substitution: line 10: unexpected EOF while looking for matching `"'
./ command substitution: line 11: syntax error: unexpected end of file
./ command substitution: line 5: unexpected EOF while looking for matching `"'
./ command substitution: line 7: syntax error: unexpected end of file
./ line 5: -l: command not found

Old 08-22-2006, 03: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).


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 01:25 PM
shell script - while loop with multiple conditions ronsha Programming 13 12-10-2005 04:08 PM
Problem with simple shell script for loop abefroman Programming 2 10-25-2005 08:26 PM
shell script won't execute brandnewbie Linux - Newbie 7 08-10-2004 01:30 PM
Remote Win Bat File execute Shell Script on AIX Server DriveMeCrazy AIX 5 05-26-2004 06:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:18 PM.

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