The command that sets the Bash variable named TEST with the content FOO is option D, TEST="FOO".
Explanation:
Option A, set TEST="FOO", sets the positional parameters of the current shell to TEST=FOO. It does not set the variable TEST.
Option B, TEST = "FOO", attempts to run a command named TEST with two arguments, = and "FOO". It does not set the variable TEST.
Option C, var TEST="FOO", is not valid Bash syntax for setting a variable. It is likely used in a different shell or programming language.
Option D, TEST="FOO", sets the variable TEST to the string FOO.
Therefore, to set the Bash variable named TEST with the content FOO, you should use the command TEST="FOO".
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Strib
6 months, 3 weeks agorona962
9 months ago