Re: are head/tail allowed (required?) to rewind stdin

2018-04-30 Thread Stephane Chazelas
2018-04-30 16:49:34 +0100, Geoff Clare: [...] > Yes, but it clearly shows that this offset is intended to be honoured > by the next utility to read from stdin, when it says: > > tail -n +2 file > (sed -n 1q; cat) < file > [...] > The second command is equivalent to the first only

Re: are head/tail allowed (required?) to rewind stdin

2018-04-30 Thread Geoff Clare
Stephane Chazelas wrote, on 30 Apr 2018: > > 2018-04-30 15:50:10 +0100, Geoff Clare: > > Stephane Chazelas > > wrote, on 30 > > Apr 2018: > > > > > > The head/tail specifications refer to line/byte offsets

Re: are head/tail allowed (required?) to rewind stdin

2018-04-30 Thread Stephane Chazelas
2018-04-30 15:50:10 +0100, Geoff Clare: > Stephane Chazelas > wrote, on 30 Apr 2018: > > > > The head/tail specifications refer to line/byte offsets as > > offsets within *files* as opposed to *input*. > > > > Does it mean that: > > >

Re: are head/tail allowed (required?) to rewind stdin

2018-04-30 Thread Geoff Clare
Stephane Chazelas wrote, on 30 Apr 2018: > > The head/tail specifications refer to line/byte offsets as > offsets within *files* as opposed to *input*. > > Does it mean that: > > { head -n 1; head -n 1; } < file > { tail -n 1; tail -n 1; } < file > > are required