Oracle Linux 6 System Administration — Question 2

You want to display the value of a shell variable called service after assigning a value as shown:

SERVICE =ACCT S -
Which two settings will display the name of the variable and its value?

Answer options

Correct answer: B, C

Explanation

The correct answers are B and C because 'echo $SERVICE' directly prints the value of the variable to the terminal, while 'env | grep SERVICE' filters the environment variables to show only the one corresponding to SERVICE. The other options either do not display the variable's value or are not valid commands for this purpose.