Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 010-160 Exam - Topic 2 Question 72 Discussion

Posted by Chantell on Sep 30, 2026 at 06:15 AM

Which of the following commands sets the variable USERNAME to the value bob?

Suggested Answer: E

The correct command to set the variable USERNAME to the value bob is USERNAME=bob. This command assigns the string bob to the variable name USERNAME, using the equal sign (=) as the assignment operator. There is no space around the equal sign, and the variable name and value are case-sensitive. This command sets a shell variable, which is only valid in the current shell session. To make the variable an environment variable, which can be inherited by child processes and subshells, you need to use the export command, such as export USERNAME=bob. The other commands are not valid for setting variables in Linux. The set command is used to set or unset shell options and positional parameters, not variables. The $ sign is used to reference the value of a variable, not to assign it. The == sign is used for comparison, not assignment. The var keyword is not used in Linux, but in some other programming languages. The <= sign is used for redirection, not assignment.Reference:

Linux Essentials - Linux Professional Institute (LPI)

How to Set and List Environment Variables in Linux | Linuxize


Get Premium 010-160 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
9 comments · newest first
BE
Belen 3 days ago
B) is totally wrong, right?
FR
Fredric 8 days ago
Wait, are we sure about that? Seems too simple.
VI
Vicki 13 days ago
No way, it's E) for sure.
FE
Felix 18 days ago
I thought it was A) set USERNAME bob at first!
CA
Cammy 24 days ago
It's definitely E) USERNAME=bob.
MI
Mike 29 days ago
I don't recall seeing C before, but it seems off compared to what I learned.
KI
Kindra 1 month ago
I'm a bit unsure, but I think A could also be a possibility.
NI
Nikita 1 month ago
I remember practicing with similar questions, and I feel like E is the correct syntax.
LE
Leonida 1 month ago
I think it's definitely not B or D, those don't look right to me.
0/2000 characters

Save Cancel