Variables shell script- Q3

Hi Team, I tried to perform the necessary solutions for this question but the answer is getting wrong, can you please help me with the correct solution for below question that will be helpful.

Another script by the name is placed in your home directory at /home/bob .

It must print the uptime of the system as expected. However it’s not working’. Please inspect and fix the problem with the script.

Answer :



echo “The uptime of the system is $uptime”

Hi @Afshan

The bug you need to fix with this script is with the variable name. - (dash) character is not a valid character in variable names. Replace with _ (underscore) to pass the question.

1 Like