New Year Sale 2026! 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 7 Discussion

Actual exam question for LPI's 010-160 exam
Question #: 7
Topic #: 2
[All 010-160 Questions]

The file script.sh in the current directory contains the following content:

#!/bin/bash echo $MYVAR

The following commands are used to execute this script:

MYVAR=value

./script.sh

The result is an empty line instead of the content of the variable MYVAR. How should MYVAR be set in order to make script.sh display the content of MYVAR?

Show Suggested Answer Hide Answer
Suggested Answer: E

Contribute your Thoughts:

0/2000 characters
Hayley
4 months ago
No way, I thought just setting it would be enough.
upvoted 0 times
...
Lawanda
4 months ago
Definitely export MYVAR=value for it to work!
upvoted 0 times
...
Tammi
4 months ago
Wait, why is it empty? That seems weird.
upvoted 0 times
...
Shannan
4 months ago
I think it needs to be exported, right?
upvoted 0 times
...
Sage
5 months ago
Just set MYVAR before running the script.
upvoted 0 times
...
Merilyn
5 months ago
I thought you just needed to set the variable normally, like in option C, but now I'm second-guessing myself.
upvoted 0 times
...
Rolande
5 months ago
I feel like I saw something about using `env` in a practice question, so option B could be the right choice.
upvoted 0 times
...
Carolynn
5 months ago
I'm not entirely sure, but I think setting MYVAR directly before running the script might not work as expected. Wasn't there a similar question about variable scope?
upvoted 0 times
...
Dean
5 months ago
I remember that environment variables need to be exported for child processes to access them, so maybe it's option E?
upvoted 0 times
...
Whitley
5 months ago
Hmm, I'm a bit unsure about this one. The options seem pretty technical, and I'm not super familiar with the details of this imaging system. I'll have to think it through carefully.
upvoted 0 times
...
Valentin
5 months ago
This one seems straightforward - the Product Owner is trying to understand the context and stakeholders, which aligns with the "See the Whole" principle of agile business analysis.
upvoted 0 times
...
Wilford
5 months ago
I've got a good feeling about this one. The options seem to cover some common drivers of service satisfaction, so I'll review them carefully and select the most relevant one.
upvoted 0 times
...
Leonor
5 months ago
I've seen this type of issue before. The key might be in the `startTest()` and `stopTest()` methods. If the `executeBatch()` call is not properly wrapped, it could be causing the coverage problem.
upvoted 0 times
...

Save Cancel