bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#52077: tail: a case where -n is not taken as implicit


From: Pádraig Brady
Subject: bug#52077: tail: a case where -n is not taken as implicit
Date: Wed, 24 Nov 2021 15:56:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Thunderbird/95.0

tag 52077 notabug
close 52077
stop

On 24/11/2021 07:38, Shehu Dikko wrote:
Package: coreutils
Version: 9.0

Do please take a look at this example:

% printf '%s\n' just three lines | tee >f1 f2
% tail -n1 f1
lines
% tail -n1 f*
==> f1 <==
lines

==> f2 <==
lines
% tail -1 f1
lines
% tail -1 f*
tail: option used in invalid context -- 1
% tail --version | head -1
tail (GNU coreutils) 9.0

Note that with head and busybox tail, the outputs are unsurprising:

% head -1 f*
==> f1 <==
just

==> f2 <==
just
% head --version | head -1
head (GNU coreutils) 9.0
% busybox tail -1 f*
==> f1 <==
lines

==> f2 <==
lines
%
% uname -v
#1 SMP Debian 4.19.194-3 (2021-07-18)

The compat for that older syntax is not extended to multiple files.
From the info docs:

  For compatibility ‘tail’ also supports an obsolete usage ‘tail
  -[NUM][bcl][f] [FILE]’, which is recognized only if it does not conflict
  with the usage described above.  This obsolete form uses exactly one
  option and at most one file.

cheers,
Pádraig





reply via email to

[Prev in Thread] Current Thread [Next in Thread]