fa.openbsd.tech
[Top] [All Lists]

Re: [patch] ps.c ps.1 Disregard terminal width when STDOUT is not a tty

Subject: Re: [patch] ps.c ps.1 Disregard terminal width when STDOUT is not a tty (take 2)
From: "Nick Guenther" <kousue@xxxxxxxxx>
Date: Mon, 21 Jul 2008 15:04:12 UTC
Newsgroups: fa.openbsd.tech

On Mon, Jul 21, 2008 at 8:32 AM, Hannah Schroeter <hannah@xxxxxxxxxx> wrote:
> Hi!
>
> On Mon, Jul 21, 2008 at 12:18:04PM +1000, Evan Clarke wrote:
>>On 21/07/2008, Theo de Raadt <deraadt@xxxxxxxxxxxxxxx> wrote:
>>> I don't particularily like this.  I think you should use the option "ww".
>
>>>     -w      Use 132 columns to display information, instead of the default,
>>>             which is the window size.  If the -w option is specified more
>>>             than once, ps will use as many columns as necessary without re-
>>>             gard for window size.
>
>>> As in, this is already a solved problem.
>
>>You do raise a valid point.  My main reason for the patch is that I
>>have a couple of scripts that I don't control, that assume the ww on
>>STDOUT!=tty, and break if it isn't present - I am assuming because the
>>GNU tools (and maybe others) do this.
>
>>This patch stops scripts behaviour from being dependant on the
>>terminal size - it adds a certain level of certainty on the output, in
>>a similar way to how ls changes behaviour of its output if it is
>>piping.
>
> I wouldn't like your patch.
>
> No way to tell ps to create terminal width output for ps ... | grep
> pipes any more.

Huh? How do you use that? Isn't the point that grep searches records
of related information? Why would you ever want it to be dealing with
results split across lines?
-Nick


<Prev in Thread] Current Thread [Next in Thread>