Anchor(faq91)

I'm trying to get the number of columns or lines of my terminal but the variables COLUMNS / LINES are always empty

COLUMNS and LINES are set by bash only in interactive shells, they do not work in a script. Instead you can use:

COLUMNS=$(tput cols)
LINES=$(tput lines)

If you want these variables to but updated when the terminal is resized, ie upon receipt of a SIGWINCH, you can set the trap yourself:

trap 'COLUMNS=$(tput cols)' WINCH