Linux Foundation Certified System Administrator (LFCS) — Question 130

How can the existing environment variable FOOBAR be suppressed for the execution of the script./myscript only?

Answer options

Correct answer: C

Explanation

The correct answer is C, as 'env -u FOOBAR' removes the FOOBAR variable for the command that follows it, allowing ./myscript to run without it. Option A uses 'unset -v', which does not affect the environment during command execution. Option B sets FOOBAR to an empty string instead of removing it, and option D creates a new environment without any variables, which is not the goal of suppressing FOOBAR specifically.