Answers

Question and Answer:

  Home  Linux Shell

⟩ 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

a) hello

Explanation:

After the execution of the 'readonly' command, shell will not provide the permission to overwrite the value stored in variable 'san_var'.

Output:

root@ubuntu:/home/google# ./test.sh

./test.sh: line 4: san_var: readonly variable

hello

root@ubuntu:/home/google#

 153 views

More Questions for you: