Se eu fosse adivinhar, suspeitaria de IFS . set lists IFS também. E para mim, IFS is (espaço, tabulação horizontal, nova linha e nul):
$ printf "%s" "$IFS" | od -a
0000000 sp ht nl nul
0000004
A presença do caractere NUL ( ) faz com que grepgrep o trate como um arquivo binário, portanto, dependendo do seu grep , você poderá ver:
$ set | grep COLUMNS
Binary file (standard input) matches
Você pode forçar %code% a tratar a entrada como texto:
-a, --text
Process a binary file as if it were text; this is equivalent
to the --binary-files=text option.
E assim:
$ set | grep COLUMNS --text
COLUMNS=239