Linux OS Shell Question:

What is the output of this program?

#!/bin/bash
san_var=10
echo "the value of "san_var" is $san_var"
exit 0
a) the value of "san_var" is 10
b) the value of is 10
c) the value of san_var is $san_var
d) the value of "san_var" is $san_var

Linux Shell Interview Question
Linux Shell Interview Question

Answer:

a) the value of "san_var" is 10
Output:
root@ubuntu:/home/google# ./test.sh
the value of "san_var" is 10
root@ubuntu:/home/google#


Previous QuestionNext Question
What is the output of this program?

#!/bin/bash
san_var=hello
readonly san_var
san_var=hi
echo $san_var
exit 0
a) hello
b) hi
c) nothing will print
d) none of the mentioned
To redefine a variable, it can be removed from the list of variables by using the command:
a) unset
b) delete
c) remove
d) clear