[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tail weirdness
From: |
Eric Blake |
Subject: |
Re: tail weirdness |
Date: |
Tue, 06 Feb 2007 07:16:59 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Igor Rivin on 2/6/2007 6:32 AM:
> On my Fedora core 6 system, this fails:
>
> address@hidden tmp]$ tail +2 dog
> tail: cannot open `+2' for reading: No such file or directory
This is becoming a FAQ; would anyone care to add it to
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html?
> address@hidden tmp]$ tail --version
> tail (GNU coreutils) 5.97
Consider upgrading - the lateset stable version is 6.7. It will not
change the behavior of tail in your case, but has other improvements.
The short answer is that POSIX is the driving factor here, and that Fedora
core 6 has chosen POSIX 1003.1-2001 as their default. Depending on which
version of POSIX you are compliant with, tail is specified to treat +3
differently. This is documented in the NEWS for 5.90:
A few usages still have behavior that depends on which POSIX standard is
being conformed to, and portable applications should beware these
problematic usages. These include:
Problematic Standard-conforming replacement, depending on
usage whether you prefer the behavior of:
POSIX 1003.2-1992 POSIX 1003.1-2001
sort +4 sort -k 5 sort ./+4
tail +4 tail -n +4 tail ./+4
tail - f tail f [see (*) below]
tail -c 4 tail -c 10 ./4 tail -c4
Also, see 'info coreutils standards' - your choice of _POSIX2_VERSION in
the environment chooses which version of POSIX you want tail to comply to.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFyI3a84KuGfSFAYARAhp9AJ9gp9i0BqJlp9FvlFLzO0OO+Kk6MACeOKEw
nrQBf8ycI66wJgSnPEhbiwk=
=9YBj
-----END PGP SIGNATURE-----
- tail weirdness, Igor Rivin, 2007/02/06
- Re: tail weirdness,
Eric Blake <=