How should MYVAR be set in order to make script.sh display the content of MYVAR?

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
B. env MYVAR=value
C. MYVAR=value
D. $MYVAR=value
E. export MYVAR=value

Download Printable PDF. VALID exam to help you PASS.

One thought on “How should MYVAR be set in order to make script.sh display the content of MYVAR?

  1. I think this code to display the content of MYVAR
    #/bin/bash
    MYVAR=value
    echo $MYVAR
    I tried replacing “export MYVAR = value” in script.sh file but the result is nothing. So I don’t understand this question

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.