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?

Which of the following is the best way to list all defined shell variables?

A.
env

B.
set

C.
env -a

D.
echo $ENV

Explanation/Reference:
A) env – run a program in a modified environment (-a does not exist)
C) option -a does not exist
D) echo $ENV prints the shell variable $ENV if it exists



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Simon

Simon

Is this not answer A. env ?

Alukardd

Alukardd

No, “set” is correct answer. I think it’s true.

Chris C

Chris C

It says env in the text book.

AKA

AKA

There is a difference between SHELL and ENVIRONMENT variables!
For shell-varĀ“s the correct way is set as right selected in the answer.
For display all environment variables you can use env!

regards

Nick

Nick

SET is used to get the path value and by experience, ENV is the answer.