![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Checking condition inside the loop | ithirak17 | Shell Programming and Scripting | 1 | 03-13-2008 08:37 AM |
| remsh inside of while loop | joettacm | UNIX for Advanced & Expert Users | 1 | 12-07-2007 12:54 PM |
| Repetitive Tasks: using if..then inside a loop | garak | Shell Programming and Scripting | 2 | 03-13-2006 07:36 AM |
| input inside while read loop | jhansrod | Shell Programming and Scripting | 3 | 08-13-2005 10:46 AM |
| read inside a while loop | dta4316 | UNIX for Dummies Questions & Answers | 3 | 05-21-2005 10:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
rsh script with inside a for loop
hi everyone,
I have the following problem: the foreach loop inside rsh doesn'work. I have tried the for command but it's not recognized. with the foreach command I don't receive any error, but it doesn't really make the cycle, ignoring the foreach and executing 1 time the echo command. Anyone has ideas? rsh host "cd a/b exe<< stop 1 2 stop exe2<<stop2 a b stop2 foreach ptcluster (30 35 40 45 50) echo PTCLUS=$ptcluster end " I have read read the following statement, but I don't know if it is the real issue: "When this command is read from the terminal, the loop is read once prompting with `foreach? ' (or prompt2) before any statements in the loop are executed. If you make a mistake typing in a loop at the terminal you can rub it out." |
|
||||
|
suggestion
hi, thank you for the suggestion, but the thread you have pointed out is quite different from my issue:
I want to perform a loop inside the compound command. in any case I have tried the suggestion, but didn't worked. Cheers Michele |
|
||||
|
I have tried this workaround (even if I see it as a defiance :-) ).
but another problem arised: i want to keep the control in the main script of the variable to be passed so I would like to pass them to the script. this is the "inner" script: #!/bin/sh # loop through a set of numbers # echo $pt echo nome$1 echo pt$2 echo eta$3 for i in 1 2 ; do ../herlib/hwuser<<stop ; $1 $2 $3 $i stop done when I do $ ./forloop a b c it works but when it is called by another script it fails to recognize the variables. for example: I call the previous script (forloop) through name=tt_25_5_0jet pt=20 eta=0.6 ./forloop<<stop $name $pt $eta stop but don't work... any idea? THANKS in advance Michele |
|
||||
|
Use -n with rsh command & then you'r probelem will surely get solve.
EG: rsh host -n "cd a/b Regards, Lahiru Jeewantha Quote:
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|