bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: set -a leads to truncated output from ps


From: Oğuz
Subject: Re: set -a leads to truncated output from ps
Date: Sat, 15 Jun 2024 07:48:42 +0300

On Saturday, June 15, 2024, Koichi Murase <myoga.murase@gmail.com> wrote:
>
> Also, the behavior of the `ps' command honoring COLUMNS to format its
> output is also an expected one.
>

The fact that programs giving precedence to COLUMNS over the terminal API
are so common is an argument against exporting COLUMNS behind the user's
back though.

Right now, if you're dealing with such a program while `set -a' is in
effect, in order to suppress COLUMNS you need to unexport it before every
command:

$ set -a
$ env | grep COLUMNS
$ env | grep COLUMNS
COLUMNS=64
$
$ declare +x COLUMNS
$ env | grep COLUMNS
$ env | grep COLUMNS
COLUMNS=64

This is true for non-interactive shells where job control is enabled as
well.

If Bash didn't export COLUMNS implicitly but you wanted it to take effect,
you'd export it yourself once and it'd work fine. Clean and straightforward.


-- 
Oğuz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]