Package: coreutils
Version: 8.30-3
Severity: normal
Tags: upstream
Dear Maintainer,
When requesting the first four lines of a ten-line input using
printf '%2d\n' {1..10} | head -n 4
in GNU bash, the output is
1
2
3
4
as expected. However, when asking for the first 14 lines using
printf '%2d\n' {1..10} | head -n 14
the output is
1
2
3
4
5
6
7
8
9
10
which, strictly speaking, is incorrect, because the output does
not contain exactly 14 lines.
I suggest changing the documentation to read "at most N
lines" instead of just "N lines", mutatis mutandis, in various
places. Alternatively, print a warning "input has too few lines"
or similar. I am undecided as to whether the exit status should
reflect this.
-- System Information:
Debian Release: 10.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 4.19.0-8-amd64 (SMP w/8 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), LANGUAGE=en_US:en
(charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages coreutils depends on:
ii libacl1 2.2.53-4
ii libattr1 1:2.4.48-4
ii libc6 2.28-10
ii libselinux1 2.8-1+b1
coreutils recommends no packages.
coreutils suggests no packages.
-- no debconf information