![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| while loop inside while loop | panknil | Shell Programming and Scripting | 0 | 01-07-2008 09:49 AM |
| For loop | xramm | HP-UX | 3 | 10-10-2007 11:20 AM |
| While Loop | hemangjani | Shell Programming and Scripting | 2 | 11-02-2006 08:01 AM |
| for loop | munnabhai1 | Shell Programming and Scripting | 3 | 04-06-2006 11:30 AM |
| how to get the similar function in while loop or for loop | trynew | Shell Programming and Scripting | 3 | 06-17-2002 08:09 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
rsh and for loop
hi
I wanted to use the for loop structure in tandem with rsh command and the result to be redirected into a local .lst file within a shell script . Tried the following but does not help rsh ABCD "cd /bosp/local/home/linus/;for i in `ls -ltr | grep ^- | awk {'print $9'}` do echo service:`pwd` /`sum $i | awk {'print $3 ":" $1'}``ls -ltr $i | awk {'print ":"$1'}` done">>/bosp/local/home/linus/result/cde.lst; Thanx in advance newbee2005 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
That super complex compound command is delimited by double quotes. But it also has double quotes internally. That is not gonna work.
|
|
#3
|
|||
|
|||
|
Thanx
u are rite, i had to seperate the commands as -those in the For condition -those inside the do loop by seperate sets of double quotes ... but another issue that i didnt face before is that the commands within the do loop again have to be individually seperatd by semi colons , but that causes the result to be displayed on seperate lines , whereas i want the result of one loop to be on the same line , can anyone help with that ... "echo service:`pwd` /;"sum $i | awk {'print $3 ":" $1'}";"ls -ltr $i | awk {'print ":"$1'}"" newbee2005 |
|
#4
|
||||
|
||||
|
You should make your complex compound command into a shell script. And then just run that script.
|
|
#5
|
|||
|
|||
|
This piece of command is actually a shell script .
There is a second shell script which depends on this script . I was trying to eliminate the need for having 2 different scripts by including one in the other thats when the problem .... so having this as a script is not possible |
|||
| Google The UNIX and Linux Forums |