GNU bug report logs - #47243
pr lacks -p

Previous Next

Package: coreutils;

Reported by: Eric Blake <eblake <at> redhat.com>

Date: Thu, 18 Mar 2021 15:39:01 UTC

Severity: wishlist

Full log


Message #19 received at 47243 <at> debbugs.gnu.org (full text, mbox):

From: Collin Funk <collin.funk1 <at> gmail.com>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 47243 <at> debbugs.gnu.org
Subject: Re: bug#47243: pr lacks -p
Date: Sun, 27 Jul 2025 16:37:31 -0700
Hi Pádraig,

Pádraig Brady <P <at> draigBrady.com> writes:

>>> Given that hardly anybody uses pr any more, I'm surprised that the
>>> Austin Group still cares about its options. It's an obsolete utility,
>>> and ought to be deprecated.
>> True, but this option seems simple enough to implement.
>> How about the attached patch?
>
> I would just ignore the -p if stdin/stdout are not a tty.
> That would make a test easier anyway, to ensure
> `pr -p file >/dev/null` passes.

Thanks for the input.

I was conflicted on whether the best behavior was to warn, error, or
ignore the option in those cases. And whether it should be ignored if
standard out was not a tty. I guess it would be pointless to do, for
example, 'pr -p ChangeLog < file-full-of-newlines'.

I have attached the V2 patch which adds the additional check for
'isatty (STDIN_FILENO)' (V1 only had it for STDERR_FILENO), documents
that behavior, and adds a NEWS entry.

I'll push tomorrow to give others some time to comment.

Collin




This bug report was last modified 8 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.