tail +123 or tail -n +123?

wwp subscript at free.fr
Sun Apr 16 14:01:38 UTC 2006


Hello Gérard,


On Sun, 16 Apr 2006 15:18:56 +0200 Gérard Milmeister <gemi at bluewin.ch> wrote:

> On Sun, 2006-04-16 at 08:28 -0500, Aaron Konstam wrote:
> > On Sun, 2006-04-16 at 12:39 +0200, wwp wrote:
> > > Hello all,
> > > 
> > > 
> > > since I've installed FC5 (was using FC3 before), many self-installer
> > > scripts fail to install because of tail. They use `tail +123` but the
> > > tail version that comes w/ FC5 only accepts `tail -n +123`. Is that a
> > > change in tail's command-line or a bug in this version? I work around
> > > this issue by editing the scripts and inserting a -n, but would like to
> > > know what's the problem here. Any one?
> > > 
> > Well it looks like you got it right. No one bothered to change the man
> > poage but in order to start displaying a file from line 3 you needs to
> > enter:
> > tail -n +3 file
> 
> Yes, the manpage is not up-to-date, however 'info tail' is.
> The new behaviour is standard compliant, to revert to the
> previous behaviour you can also set the environment variable
> _POSIX2_VERSION=199209.

Thanks for the clarification and for the tip :-).

My real ugly workaround was:
#!/bin/sh

test "${1:0:1}" == "+" && \
        /usr/bin/tail -n "$@" || \
        /usr/bin/tail "$@"
exit $?


Regards,

-- 
wwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060416/91dcb69c/attachment-0001.sig>


More information about the fedora-list mailing list