On Thu, Jun 13, 2024 at 06:28:23PM +0000, Alain BROSSARD via Bug reports for 
the GNU Bourne Again SHell wrote:
>    My conclusion is that the variable COLUMNS gets “reset” when there is a 
> pipe in a command and further gets EXPORTED if “set -a” was set before hand :
> 
> host:/$ COLUMNS=80
> host:/$ echo $COLUMNS
> 80
> host:/$ echo $COLUMNS
> 80
> host:/$ echo $COLUMNS | cat
> 80
> host:/$ echo $COLUMNS
> 102

OK, that's interesting.  I can confirm this in Debian's bash 5.2.15:

hobbit:~$ bash
hobbit:~$ set -a
hobbit:~$ env | grep COLUMN
hobbit:~$ true | false
hobbit:~$ env | grep COLUMN
COLUMNS=80
hobbit:~$ echo $BASH_VERSION
5.2.15(1)-release

I did not move or resize the window at any time during this test.

The same thing happens in a compiled upstream 5.2.26:

hobbit:~$ bash-5.2.26
hobbit:~$ set -a
hobbit:~$ env | grep COLUMN
hobbit:~$ env | grep COLUMN
COLUMNS=80

Again, I did not move or resize this window during this test.  It is an
80x24 rxvt-unicode terminal, about as plain as you can get.  I get the
same result in an xterm also.

I still have no idea why you're running set -a in an interactive shell.

  • set -a leads... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
    • Re: set... alex xmb sw ratchev
      • RE:... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
        • ... alex xmb sw ratchev
          • ... alex xmb sw ratchev
        • ... Oğuz
          • ... alex xmb sw ratchev
          • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
            • ... Oğuz
              • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
                • ... Greg Wooledge
                • ... alex xmb sw ratchev
          • ... Robert Elz
    • Re: set... Andreas Schwab
      • RE:... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
        • ... Chet Ramey
          • ... Oğuz
          • ... Alain BROSSARD
            • ... Greg Wooledge
              • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
                • ... Greg Wooledge

Reply via email to