QuestionQ11
VerifiedThe Power of the Command LineThe file script.sh in the current directory has the following contents:
#!/bin/bash
echo $MYVAR
The following commands are used to run this script:
MYVAR=value -
./script.sh
The result is an empty line rather than the value of the MYVAR variable. How must MYVAR be set so that script.sh displays its value?
Community Discussion