Re: named-pipe in a loop

From: Green, Simon (Simon.Green@EU.ALTRIA.COM)
Date: Fri Oct 10 2003 - 04:00:42 EDT


I have something similar.

stuff | my.script

Then in the script...
#!/bin/ksh

while :
do
 read var1 var2 var3....
 process the data
 read whole_line
 process some more
done

cat won't work, because that reads the whole file, then ends. If you need
to do something like that, use "tail -f". In my case the program I'm
reading from takes care of that.

Simon Green
Altria ITSC Europe Ltd

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l
<http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2> &r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/
<http://www.faqs.org/faqs/aix-faq/>

N.B. Unsolicited email from vendors will not be appreciated.

-----Original Message-----
From: Taylor, David [mailto:DTaylor@WBMI.COM]
Sent: 09 October 2003 21:58
To: aix-l@Princeton.EDU
Subject: named-pipe in a loop

I would like to create an infinite loop, in a shell script, based upon
listening to named pipe. Does anyone know how to do this?



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:17:16 EDT