Package: coreutils
Version: 8.32-4+b1
Version: 9.1-1
Severity: normal

Dear Maintainer,

As an extension, coreutils supports having the form feed character
act as "end of page in input file", and, like many pr extensions,
this is for compatibility with SysVr4.

Under SysVr4, FF in an input line splits it in twain:
the bit before the FF is a line on the current page,
the bit after  the FF is a line on the next page.
This is obvious and expected behaviour.

Indeed, they agree (sans #1034858):
-- >8 --
% { seq 56; printf 'a\fb\n'; } | pr | cat -sA
$
2023-05-02 17:46                                                  Page 1$
$
1$
2$
3$
4$
5$
6$
7$
8$
9$
10$
11$
12$
13$
14$
15$
16$
17$
18$
19$
20$
21$
22$
23$
24$
25$
26$
27$
28$
29$
30$
31$
32$
33$
34$
35$
36$
37$
38$
39$
40$
41$
42$
43$
44$
45$
46$
47$
48$
49$
50$
51$
52$
53$
54$
55$
56$
$
2023-05-02 17:46                                                  Page 2$
$
a$
$
2023-05-02 17:46                                                  Page 3$
$
b$
$

% { seq 55; printf 'a\fb\n'; } | pr | cat -sA
$
2023-05-02 17:52                                                  Page 1$
$
1$
2$
3$
4$
5$
6$
7$
8$
9$
10$
11$
12$
13$
14$
15$
16$
17$
18$
19$
20$
21$
22$
23$
24$
25$
26$
27$
28$
29$
30$
31$
32$
33$
34$
35$
36$
37$
38$
39$
40$
41$
42$
43$
44$
45$
46$
47$
48$
49$
50$
51$
52$
53$
54$
55$
a$
$
2023-05-02 17:52                                                  Page 2$
$
b$
$
-- >8 --

But not always. Here, coreutils pr eats the first line:
-- >8 --
% { seq 56; printf '\fb\n'; } | pr | cat -sA | tail
52$
53$
54$
55$
56$
$
2023-05-02 17:53                                                  Page 2$
$
b$
$
% { seq 56; printf '\fb\n'; } | ./a.out | cat -sA | tail
54$
55$
56$
$
May  2 17:53 2023   Page 2$
$
May  2 17:53 2023   Page 3$
$
b$
$
-- >8 --

And here the second:
-- >8 --
% { seq 56; printf 'a\f\n'; } | pr | cat -sA | tail
52$
53$
54$
55$
56$
$
2023-05-02 17:54                                                  Page 2$
$
a$
$
% { seq 56; printf 'a\f\n'; } | ./a.out | cat -sA | tail
54$
55$
56$
$
May  2 17:54 2023   Page 2$
$
a$
$
May  2 17:54 2023   Page 3$
$

% { seq 55; printf 'a\f\n'; } | pr | cat -sA | tail
48$
49$
50$
51$
52$
53$
54$
55$
a$
$
% { seq 55; printf 'a\f\n'; } | ./a.out | cat -sA | tail
50$
51$
52$
53$
54$
55$
a$
$
May  2 17:55 2023   Page 2$
$
-- >8 --

And here both:
-- >8 --
% { seq 56; printf '\f\n'; } | pr | cat -sA | tail
48$
49$
50$
51$
52$
53$
54$
55$
56$
$
% { seq 56; printf '\f\n'; } | ./a.out | cat -sA | tail
52$
53$
54$
55$
56$
$
May  2 17:55 2023   Page 2$
$
May  2 17:55 2023   Page 3$
$

% { seq 55; printf '\f\n'; } | pr | cat -sA | tail
47$
48$
49$
50$
51$
52$
53$
54$
55$
$
% { seq 55; printf '\f\n'; } | ./a.out | cat -sA | tail
49$
50$
51$
52$
53$
54$
55$
$
May  2 17:56 2023   Page 2$
$
-- >8 --

It's unclear to me why you'd want this, especially with a trivial-to-use
well-defined interface to copy.

Best,
наб

-- System Information:
Debian Release: 12.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64, i386

Kernel: Linux 6.1.0-2-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages coreutils depends on:
ii  libacl1      2.3.1-3
ii  libattr1     1:2.5.1-4
ii  libc6        2.36-9
ii  libgmp10     2:6.2.1+dfsg1-1.1
ii  libselinux1  3.4-1+b5

coreutils recommends no packages.

coreutils suggests no packages.

-- no debconf information

Attachment: signature.asc
Description: PGP signature

Reply via email to