Answers

Question and Answer:

  Home  Linux Shell

⟩ What is the output of this program? #!/bin/sh echo "Just call the function" san_function san_function() { echo "This is a function" } exit 0 a) only first string will print without any error b) only second string will print without any error c) both strings will print d) none of the mentioned

d) none of the mentioned

Explanation:

Function must be defined prior to call. Hence only first string will print and program will generate an error also.

Output:

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

Just call the function

./test.sh: 3: san_function: not found

root@ubuntu:/home/globalguideline#

 128 views

More Questions for you: