Great article! Thanks!
@bros/Soren: I experience the same problem with my bash 2.05b.0.
The following does work and demonstrates the principle being described:
cat afile | (ls afile; rm afile; ls afile; head -1)
However, the head command on my system causes STDIN to stop flowing; i.e.:
cat afile | (head -1; head -1)
only returns 1 line:
daemon:x:1:1:Owner of many system processes:/usr/sbin:/bin/sh
A workaround is to replace each 'head -1' with 'read line; echo "$line"'
Allen »
'head -1'with 'read line; echo "$line"' Allen »