Which of the following is the best way to list all defined shell variables?
A.
echo $ENV
B.
env
C.
env a
D.
set
Which of the following is the best way to list all defined shell variables?
Which of the following is the best way to list all defined shell variables?
A.
echo $ENV
B.
env
C.
env a
D.
set
The ‘set’ command is a shell command that allows a user to set environmental variables. The ‘env’ command will echo all the variables that are set in a user’s environment, however, the -a option does not exist. As for ‘echo $ENV’, this will only display the environmental variable that’s defined for ENV.
B is the correct answer.