I'd like to
echo all non-environment variables (all self-declared variables), in Bash 3.2.52.
This command to print all variables gave me output I can't understand that seems to me to conflict with the
set -x && clear -r mode I already work in.
diff -U 1 <(set -o posix ; set |cut -d= -f1) <( exec bash -ic 'set -o posix ; set' | cut -d= -f1) | grep '^[-][^-]' | cut -d- -f2 | grep -vE '^(COLUMNS|HISTFILESIZE|HISTSIZE|LINES|PIPESTATUS)$'
I need an
printf (or any other "simpler") operation to have such list.
If possible in this version of Bash, how can this be achieved?