Phillip Susi <[EMAIL PROTECTED]> wrote:
> cat file | ( head --lines=1 ; sed -e xxxxx )
>
> I thought that head should consume the first line from the pipe, leaving
> the rest queued for sed to consume, but this does not seem to be the
> case.
head may read an arbitrary amount of data from the pipe, although it
will print only as much as you tell it to. To get the behavior you
want, you'll have to duplicate head's behavior in sed:
cat file | sed -e '1,10{p;d;}' -e xxxxx
And in this case, cat is unnecessary too:
sed -e '1,10{p;d;}' -e xxxxx < file
paul
_______________________________________________
Bug-bash mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-bash