9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] RC shell
@ 1998-11-30 20:39 Tom
  0 siblings, 0 replies; 3+ messages in thread
From: Tom @ 1998-11-30 20:39 UTC (permalink / raw)


On Nov 26, 10:36am, Russ Cox wrote:
> Subject: re: [9fans] RC shell
> #!/bin/sh
> TESTS=full.test
>
> cat $TESTS |
> while(TESTLINE=`{read}) {
> 	...
> }

I would write

#!/bin/rc
TESTS=full.test
ifs='
'		# newline only
for(TESTLINE in `{cat $TESTS}){
	...
}

but what do I know?

-- 
Tom Duff.  I hate quotations. -Ralph Waldo Emerson




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] RC shell
@ 1998-11-26 15:36 Russ
  0 siblings, 0 replies; 3+ messages in thread
From: Russ @ 1998-11-26 15:36 UTC (permalink / raw)


#!/bin/sh
TESTS=full.test

cat $TESTS |
while(TESTLINE=`{read}) {
	...
}

that clip look suspiciously like an hbench
maindriver script.  

is there a reason to rewrite it rather than
just run it under ape/psh?





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [9fans] RC shell
@ 1998-11-26 11:39 Franklin
  0 siblings, 0 replies; 3+ messages in thread
From: Franklin @ 1998-11-26 11:39 UTC (permalink / raw)



 In Plan 9, how can I use the command:

    cat $TESTS | while read TESTLINE
    do
        ...
     done


    In Plan 9:

       TESTS = full.test

        cat $TESTS | while (read TESTLINE){

         }

term% rc program_rc
TESTLINE: file does not exist

Franklin.








^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-11-30 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-30 20:39 [9fans] RC shell Tom
  -- strict thread matches above, loose matches on Subject: below --
1998-11-26 15:36 Russ
1998-11-26 11:39 Franklin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).