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 7 Discussion

Posted by Leatha on May 07, 2022 at 12:06 AM

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?

Suggested Answer: E

Get Premium 010-160 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
13 comments · newest first
HA
Hayley 11 months ago
No way, I thought just setting it would be enough.
LA
Lawanda 12 months ago
Definitely export MYVAR=value for it to work!
TA
Tammi 12 months ago
Wait, why is it empty? That seems weird.
SH
Shannan 12 months ago
I think it needs to be exported, right?
SA
Sage 1 year ago
Just set MYVAR before running the script.
ME
Merilyn 1 year ago
I thought you just needed to set the variable normally, like in option C, but now I'm second-guessing myself.
RO
Rolande 1 year ago
I feel like I saw something about using `env` in a practice question, so option B could be the right choice.
CA
Carolynn 1 year 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?
DE
Dean 1 year ago
I remember that environment variables need to be exported for child processes to access them, so maybe it's option E?
WH
Whitley 1 year 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.
VA
Valentin 1 year 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.
WI
Wilford 1 year 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.
LE
Leonor 1 year 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.
0/2000 characters

Save Cancel