Answers

Question and Answer:

  Home  Linux Shell

⟩ What is the output of this program? #!/bin/sh var="google" san_function() { var="Linux" echo $var } san_function exit 0 a) google b) Linux c) command not found d) none of the mentioned

b) Linux

Explanation:

If local variable name is same as the global variable, it overlays the variable, but only within the function.

Output:

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

Linux

root@ubuntu:/home/google#

 147 views

More Questions for you: