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 :confused: .

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

That super complex compound command is delimited by double quotes. But it also has double quotes internally. That is not gonna work.

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

You should make your complex compound command into a shell script. And then just run that script.

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