help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Why COLUMNS is not available, when -i is set?


From: Peng Yu
Subject: [Help-bash] Why COLUMNS is not available, when -i is set?
Date: Wed, 11 Mar 2015 20:18:36 -0500

The manual says the following.

        -i        If the -i option is present, the shell is interactive.

        COLUMNS
               Used by the select compound command to determine the
terminal width when printing  selection
               lists.   Automatically  set if the checkwinsize option
is enabled or in an interactive shell
               upon receipt of a SIGWINCH.

However, when I try the following code. The variable $COLUMNS is not
available. Is it possible to somehow enable COLUMNS in a bash script?

~$ cat main1.sh
#!/usr/bin/env bash

set -i
shopt -s checkwinsize
echo "$COLUMNS"

~$ ./main1.sh



-- 
Regards,
Peng



reply via email to

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