Re: let head(1) understand `-' as stdin

2016-10-12 Thread Jan Stary
On Oct 12 23:23:18, t...@math.ethz.ch wrote: > > Let me clarify the idea. > > If a filter recognizes '-' as a name for stdin, > > then stdin can be one of the _multiple_ files being processed. > > Filters that do not recognize '-' as a name, on the other hand, > > only process stdin if it is the

Re: let head(1) understand `-' as stdin

2016-10-12 Thread Theo Buehler
> Let me clarify the idea. > If a filter recognizes '-' as a name for stdin, > then stdin can be one of the _multiple_ files being processed. > Filters that do not recognize '-' as a name, on the other hand, > only process stdin if it is the _only_ input. I understand that - is convenient, but

Re: let head(1) understand `-' as stdin

2016-10-12 Thread Theo de Raadt
>> > > The diff below makes head(1) recognize `-' >> > > as a name for the standard input, >> > > as many other utilities do. > >On Oct 11 23:55:26, schwa...@usta.de wrote: >> > Do standards permit that extension? >> >> POSIX neither requires nor forbids it, but encourages consistency >> among

Re: let head(1) understand `-' as stdin

2016-10-12 Thread Jan Stary
> > > The diff below makes head(1) recognize `-' > > > as a name for the standard input, > > > as many other utilities do. On Oct 11 23:55:26, schwa...@usta.de wrote: > > Do standards permit that extension? > > POSIX neither requires nor forbids it, but encourages consistency > among all the

Re: let head(1) understand `-' as stdin

2016-10-12 Thread Jeremie Courreges-Anglas
Ingo Schwarze writes: > Hi, > > Theo de Raadt wrote on Tue, Oct 11, 2016 at 01:35:34PM -0600: >> jca@ wrote: >>> Jan Stary writes: > The diff below makes head(1) recognize `-' as a name for the standard input, as many other utilities do. > >>>

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Ingo Schwarze
Hi, Theo de Raadt wrote on Tue, Oct 11, 2016 at 01:35:34PM -0600: > jca@ wrote: >> Jan Stary writes: >>> The diff below makes head(1) recognize `-' >>> as a name for the standard input, >>> as many other utilities do. >> Makes sense to me. The following points could be improved

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Jan Stary
On Oct 11 13:35:34, dera...@openbsd.org wrote: > This is command used in scripts. Scripts are often portable. If one > operating system has an extension, but others don't, then those > scripts become unportable to use use of these extensions. GNU head(1) has it, Solaris does not. (I don't have

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Jan Stary
On Oct 11 21:27:54, j...@wxcvbn.org wrote: > Jan Stary writes: > > > The diff below makes head(1) recognize `-' > > as a name for the standard input, > > as many other utilities do. > > Makes sense to me. The following points could be improved IMO: Updated diff below. > -

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Theo de Raadt
> On 2016/10/11 13:35, Theo de Raadt wrote: > > > Jan Stary writes: > > > > > > > The diff below makes head(1) recognize `-' > > > > as a name for the standard input, > > > > as many other utilities do. > > > > > > Makes sense to me. The following points could be improved IMO: >

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Stuart Henderson
On 2016/10/11 13:35, Theo de Raadt wrote: > > Jan Stary writes: > > > > > The diff below makes head(1) recognize `-' > > > as a name for the standard input, > > > as many other utilities do. > > > > Makes sense to me. The following points could be improved IMO: > > - using

Re: let head(1) understand `-' as stdin

2016-10-11 Thread Theo de Raadt
> Jan Stary writes: > > > The diff below makes head(1) recognize `-' > > as a name for the standard input, > > as many other utilities do. > > Makes sense to me. The following points could be improved IMO: > - using strcmp sounds cleaner than those char comparisons > - I don't

let head(1) understand `-' as stdin

2016-10-11 Thread Jan Stary
The diff below makes head(1) recognize `-' as a name for the standard input, as many other utilities do. Jan Index: head.1 === RCS file: /cvs/src/usr.bin/head/head.1,v retrieving revision 1.23 diff -u -p -r1.23 head.1 ---