On Saturday, June 15, 2024, Koichi Murase <myoga.mur...@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
        • ... Robert Elz
  • Re: set -a l... Andreas Schwab
    • RE: set... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
      • Re:... Chet Ramey
        • ... Oğuz
        • ... Alain BROSSARD
          • ... Greg Wooledge
            • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
              • ... Greg Wooledge
          • ... Koichi Murase
            • ... Oğuz
              • ... Greg Wooledge
              • ... Koichi Murase
              • ... Koichi Murase
              • ... Oğuz
              • ... Chet Ramey
              • ... alex xmb sw ratchev
              • ... Chet Ramey
              • ... alex xmb sw ratchev
              • ... Chet Ramey
          • ... Chet Ramey

Reply via email to