<div dir="ltr">The writer is:<div><div>#/bin/ksh</div><div>PIPE=/tmp/backup.pipe</div><div>[[ ! -a $PIPE ]] &amp;&amp; mkfifo $PIPE</div><div># Start gzip processes</div><div>/opt/cronjobs/zip1 &amp;</div><div>/opt/cronjobs/zip2 &amp;</div>
<div><br></div><div># Process files needing compression</div><div>let &#39;fc=0&#39;</div><div>ls /zonebackup/*tar | while read F; do</div><div>        echo $F &gt;$PIPE</div><div>        let &#39;fc=fc+1&#39;</div><div>done</div>
<div><br></div><div>echo &quot;end of list&quot; &gt;$PIPE</div><div>echo &quot;end of list&quot; &gt;$PIPE</div><div>exit 0</div></div><div><br></div><div>The readers are:</div><div><div>#/bin/ksh</div><div>PIPE=/tmp/backup.pipe<br>
</div><div>NAME=zip1</div><div>if [[ ! -a $PIPE ]]; then<br></div><div>        logger -p local0.warning &quot;$NAME can&#39;t find $PIPE -- exiting&quot;</div><div>        exit 1</div><div>fi</div><div><br></div><div>while (( 1 )); do</div>
<div>        read F &lt;$PIPE</div><div>        if [[ &quot;$F&quot; = &quot;end of list&quot; ]]; then</div><div>                break</div><div>        else</div><div>                echo &quot;$NAME: $F&quot;</div><div>
        fi</div><div>done</div></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 1, 2014 at 1:29 PM, Kevin McGregor <span dir="ltr">&lt;<a href="mailto:kevin.a.mcgregor@gmail.com" target="_blank">kevin.a.mcgregor@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I tried fiddling with IFS to no avail. I just changed it like this:<div>IFS=&#39;</div><div>&#39;</div><div>
And now the readers show all kinds of gibberish! All lines have no whitespace, save for the newline at the end. I&#39;m assuming it&#39;s at the end. </div>
</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 1, 2014 at 12:47 PM, Robert Keizer <span dir="ltr">&lt;<a href="mailto:robert@keizer.ca" target="_blank">robert@keizer.ca</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Have you tried setting IFS ( field sep )? Also you could enable raw mode with -r. </p>
<p dir="ltr">Can you share the script?</p>
<p dir="ltr">Are the same lines failing repeatedly?</p>
<p dir="ltr">Rob</p>
<div class="gmail_quote"><div><div>On 2014-03-01 11:55 AM, &quot;Kevin McGregor&quot; &lt;<a href="mailto:kevin.a.mcgregor@gmail.com" target="_blank">kevin.a.mcgregor@gmail.com</a>&gt; wrote:<br type="attribution">
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
<div dir="ltr">I have a main script which writes to a named pipe. Before it starts writing, it starts two other scripts which read from this pipe. The reading and writing is a list of file names, one per line. How do I ensure that each script reads one complete line from the pipe at a time (no more, no less)?<div>



<br></div><div>I have a test set up, and it usually works, but sometimes a reader will get a blank line or just a &quot;/&quot; (but not any other part of a line)!</div><div><br></div><div>Kevin</div></div>
<br></div></div>_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca" target="_blank">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
<br></blockquote></div>
<br>_______________________________________________<br>
Roundtable mailing list<br>
<a href="mailto:Roundtable@muug.mb.ca" target="_blank">Roundtable@muug.mb.ca</a><br>
<a href="http://www.muug.mb.ca/mailman/listinfo/roundtable" target="_blank">http://www.muug.mb.ca/mailman/listinfo/roundtable</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>