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