Le Lun 5 Juin 2006 06:05, Bob Proulx a écrit :
> Pierre Habouzit wrote:
> > what is the point of not supporting tail +n syntax, does it breaks
> > anything ?
>
> A conforming POSIX 1003.1-2001 implementation is supposed to treat
> arguments with a leading "+" as a file name, not as an option.  Some
> people do actually start file names with a "+" sign.
well, I can see a good compromise here: +[0-9][0-9]* can be treated 
as -n $1 whereas any other +.... can be treated as a file.

> (Often used in GNU arch projects for one example.)
right, I already new that choice of names was crappy, here is 
yet-another-reason.

> There is no way to make everyone happy.
>
>   printf "one\ntwo\nthree\n" > ++foo
>   tail ++foo
>   tail: +: invalid suffix character in obsolescent option

which is understood correctly if you auto-guess that ++foo is in fact a 
file.

>   printf "one\ntwo\nthree\n" > +1
>   tail +1
>   ...hang reading stdin instead of file +1...

someone writing that is completely crazy and there is a simple way to do 
that without depending on the implementation:

  tail -- +1

I really am convinced that change would make more harm that il would 
avoid.
-- 
·O·  Pierre Habouzit
··O                                                [EMAIL PROTECTED]
OOO                                                http://www.madism.org

Attachment: pgpRni3G6TJuP.pgp
Description: PGP signature

Reply via email to