ExamGecko
Question list
Search
Search

Question 68 - 010-160 discussion

Report
Export

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?

A.
!MYVAR=value
Answers
A.
!MYVAR=value
B.
env MYVAR=value
Answers
B.
env MYVAR=value
C.
MYVAR=value
Answers
C.
MYVAR=value
D.
$MYVAR=value
Answers
D.
$MYVAR=value
E.
export MYVAR=value
Answers
E.
export MYVAR=value
Suggested answer: E
asked 18/09/2024
David Sichimwi
38 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first