Re: Language selection tool
Posted: 13 Dec 2016, 15:37
But I know of no trick for any bash script to be able to read $COLUMNS
Code: Select all
#!/bin/bash
columns=$(tput cols)
echo "Columns: " $columns
But I know of no trick for any bash script to be able to read $COLUMNS
Code: Select all
#!/bin/bash
columns=$(tput cols)
echo "Columns: " $columns
Code: Select all
shopt -s checkwinsize
checkwinsize
If set, Bash checks the window size after each command and, if necessary, updates the values of LINES and COLUMNS.
Code: Select all
stty size