Kim wrote: > It appears as if the tail +n functionality has disappeared. The info > tail output still states that something like tail +2 should output > from the second line onwards, as does man tail.
Where does it say that? What I see is this: -n, --lines=N output the last N lines, instead of the last 10 If the first character of N (the number of bytes or lines) is a `+', print beginning with the Nth item from the start of each file, otherwise, print the last N items in the file. Therefore it should be 'tail -n +2'. > This functionality has been in tail on unixes from days of old (> 20 > years) and I for one have written many scripts that use this, such > as: > > ls -l | tail +2 This is a change to conform to POSIX. See the online standards documentation for more information. http://www.opengroup.org/onlinepubs/009695399/utilities/tail.html The problem is that files may start with a '+'. While filenames starting with a '-' are expected to need special attention filenames starting with a '+' are not. In the news entry for release 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 touch 12312359 f touch -t 12312359 f touch ./12312359 f uniq +4 uniq -s 4 uniq ./+4 The coreutils info documentation says: The gnu utilities normally conform to the version of POSIX that is standard for your system. To cause them to conform to a different version of POSIX, define the _POSIX2_VERSION environment variable to a value of the form yyyymm specifying the year and month the standard was adopted. Two values are currently supported for _POSIX2_VERSION: 199209 stands for POSIX 1003.2-1992, and 200112 stands for POSIX 1003.1-2001. For example, if you have a newer system but are running software that assumes an older version of POSIX and uses 'sort +1' or 'tail +10', you can work around any compatibility problems by setting _POSIX2_VERSION=199209 in your environment. You may specify that you desire POSIX 1003.2-1992 and the tail command will conform to that version of the standard. For a single command: ls -l | env _POSIX2_VERSION=199209 tail +2 But my advice is to note the change and to roll with it. Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
