「熱のエクスポート」とは何をしますか?

「熱のエクスポート」とは何をしますか?

このコマンドの重要性は何ですかexport COLUMNS

私が知っているのは、それがグローバル変数であることだけです。

* nixスクリプトの冒頭でよく見られます。

ベストアンサー1

現在の端末ウィンドウの幅(ASCII文字)。

からman bash

   COLUMNS
          Used  by  the  select  builtin command to determine the terminal
          width when printing selection  lists.   Automatically  set  upon
          receipt of a SIGWINCH.

より一般的なものもありますksh

          COLUMNS
                 If this variable is set, the value is used to define  the
                 width of the edit window for the shell edit modes and for
                 printing select lists.

実際の部分では、仮想端末ウィンドウのサイズが変更されると、この変数の値も変更されることに注意してください。 (上記の内容がSIGWINCHアクティブシェルに転送される場合です。)

おすすめ記事