2024年6月15日(土) 13:48 Oğuz <oguzismailuy...@gmail.com>:
> 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.

I'm not sure how it is against exporting COLUMNS. I agree that it may
cause unexpected behaviors when a user or a script uses the utilities
using COLUMNS in the wrong way, but the existence of the programs
using COLUMNS implies that those programs expect the users to export
it when the user likes to do it. If those programs would not expect
COLUMNS to be exported, why do these programs read the environment
variable COLUMNS in the first place?

> Right now, if you're dealing with such a program while `set -a' is in effect,

Is this a reply to me? My argument was that the script is still broken
even when the user does *not* use `set -a'. Or you repeat the
arguments to the general audience.

> in order to suppress COLUMNS you need to unexport it before every command:

In Bash, when you know you are going to use programs honoring COLUMNS
and you want to disable that, you can just run `shopt -u checkwinsize'
and `unset -v COLUMNS' only once at the beginning of the script.

However, for the portable scripts, I now agree that it is a problem
that Bash seems to enable `checkwinsize' even in the POSIX mode.

--
Koichi

  • RE: set -a l... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
    • Re: set... Chet Ramey
      • Re:... Oğuz
      • RE:... 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
      • Re:... Robert Elz
        • ... Alain BROSSARD via Bug reports for the GNU Bourne Again SHell

Reply via email to