On my search for a command to list all shell variables, I somehow realized, that there is a command to list all environment variables, but somehow there is no one to list all shell variables, for reasons unknown to me.
However, someone here gave an answer on how to display all variables, shell and environment ones.
( set -o posix ; set ) | less
He actually did not explain for the layman what this expression does, and my fragmentary understanding is not enough to grasp the idea behind it.
This is what I know:
- ( command1; command2) this causes the commands to be executed inside a child process of the shell.
set is some way to declare variables, though do not know what the -o posix means and why a second set is executed in succession
command | less This one is not the problem, even I understand it, it is a pager for more control about the output.