Re: head(1) -c

2016-03-12 Thread Ingo Schwarze
Hi, Daniel Dickman wrote on Thu, Mar 10, 2016 at 02:11:49PM -0500: > ps. if I'm reading things right, "head -c" will be in Posix, Issue 8. > http://austingroupbugs.net/view.php?id=407#c743 Oh indeed, thanks for digging up that decision, useful indeed. Well, that definitely settles the matter.

Re: head(1) -c

2016-03-11 Thread Jeremie Courreges-Anglas
Jeremie Courreges-Anglas writes: > Ingo Schwarze writes: > >> Hi, > > Hi Ingo, > >> two general remarks: >> >> 1) The head(1) utility is supposed to handle text files. Our >> manual page doesn't mention that technicality - in general, our >> manuals

Re: head(1) -c

2016-03-10 Thread lists
> To repeat myself, the addition of this rather silly option is supposed > to reduce differences from other implementations so that we can stop > wasting time about it. It should be cool to be able to run scripts that are expected to run so fine on the other POSIX targeting systems. So, push

Re: head(1) -c

2016-03-10 Thread Jeremie Courreges-Anglas
"Dmitrij D. Czarkoff" writes: > Jeremie Courreges-Anglas said: >> To repeat myself, the addition of this rather silly option is supposed >> to reduce differences from other implementations so that we can stop >> wasting time about it. > > There is a big difference between

Re: head(1) -c

2016-03-10 Thread Theo de Raadt
> Jeremie Courreges-Anglas said: > > To repeat myself, the addition of this rather silly option is supposed > > to reduce differences from other implementations so that we can stop > > wasting time about it. > > There is a big difference between providing a switch for compatibility > and

Re: head(1) -c

2016-03-10 Thread Dmitrij D. Czarkoff
Jeremie Courreges-Anglas said: > To repeat myself, the addition of this rather silly option is supposed > to reduce differences from other implementations so that we can stop > wasting time about it. There is a big difference between providing a switch for compatibility and following specific

Re: head(1) -c

2016-03-10 Thread Jeremie Courreges-Anglas
Ingo Schwarze writes: > Hi, Hi Ingo, > two general remarks: > > 1) The head(1) utility is supposed to handle text files. Our > manual page doesn't mention that technicality - in general, our > manuals avoid excessive technicality in favour of readability - > but

Re: head(1) -c

2016-03-10 Thread Ingo Schwarze
Hi, two general remarks: 1) The head(1) utility is supposed to handle text files. Our manual page doesn't mention that technicality - in general, our manuals avoid excessive technicality in favour of readability - but POSIX is explicit: "Input files shall be text files, but

Re: head(1) -c

2016-03-10 Thread Dmitrij D. Czarkoff
Jeremie Courreges-Anglas said: > The situation is a bit muddy. :) > 1. GNU head obeys the last command line option > 2. FreeBSD errors out if both -c and -n are specified > 3. NetBSD always follows -c if it has been specified, probably mixing -c >and -n was overlooked > 4. busybox is a bit

Re: head(1) -c

2016-03-09 Thread Jeremie Courreges-Anglas
Daniel Dickman writes: > On Wed, Mar 9, 2016 at 9:35 PM, Michael McConville wrote: >> Jeremie Courreges-Anglas wrote: >>> >> @@ -66,13 +66,18 @@ main(int argc, char *argv[]) >>> >>argv++; >>> >>} >>> >> >>> >> - while ((ch = getopt(argc,

Re: head(1) -c

2016-03-09 Thread Daniel Dickman
On Wed, Mar 9, 2016 at 9:35 PM, Michael McConville wrote: > Jeremie Courreges-Anglas wrote: >> >> @@ -66,13 +66,18 @@ main(int argc, char *argv[]) >> >>argv++; >> >>} >> >> >> >> - while ((ch = getopt(argc, argv, "n:")) != -1) { >> >> + while ((ch =

Re: head(1) -c

2016-03-09 Thread Jeremie Courreges-Anglas
Theo de Raadt writes: >> >> I don't see any value in being different. Plus, tail(1) already has >> >> support for -c. >> >> >> >> Comments/ok? >> > >> > Makes sense and works for me. I'll leave a few comments inline. Also: >> > >> >> PS: the next diff will remove

Re: head(1) -c

2016-03-09 Thread Theo de Raadt
> >> I don't see any value in being different. Plus, tail(1) already has > >> support for -c. > >> > >> Comments/ok? > > > > Makes sense and works for me. I'll leave a few comments inline. Also: > > > >> PS: the next diff will remove documentation for the obsolete "-count" > >> syntax. > > > >

Re: head(1) -c

2016-03-09 Thread Michael McConville
Jeremie Courreges-Anglas wrote: > >> @@ -66,13 +66,18 @@ main(int argc, char *argv[]) > >>argv++; > >>} > >> > >> - while ((ch = getopt(argc, argv, "n:")) != -1) { > >> + while ((ch = getopt(argc, argv, "c:n:")) != -1) { > >>switch (ch) { > >> + case 'c': >

Re: head(1) -c

2016-03-09 Thread Jeremie Courreges-Anglas
Michael McConville writes: > Jeremie Courreges-Anglas wrote: >> Today someone bumped into a port that contained head -c calls. While >> upstream could be prodded to care a bit more about portability, support >> for head -c is widespread (GNU coreutils, busybox, FreeBSD,

Re: head(1) -c

2016-03-09 Thread Michael McConville
Jeremie Courreges-Anglas wrote: > Today someone bumped into a port that contained head -c calls. While > upstream could be prodded to care a bit more about portability, support > for head -c is widespread (GNU coreutils, busybox, FreeBSD, NetBSD) so > I don't see any value in being different.

head(1) -c

2016-03-09 Thread Jeremie Courreges-Anglas
Today someone bumped into a port that contained head -c calls. While upstream could be prodded to care a bit more about portability, support for head -c is widespread (GNU coreutils, busybox, FreeBSD, NetBSD) so I don't see any value in being different. Plus, tail(1) already has support for -c.