Interviewer And Interviewee Guide

Linux OS Shell Interview Question:

What is the output of this program?

#!/bin/sh
san_function1() {
a=5
echo "This is the first function"
san_function2
}
san_function2() {
echo "This is the second function"
san_function3
}
san_function3() {
echo "This is the third function"
}
san_function1
exit 0
a) This is the first function
This is the second function
This is the third function

b) This is the first function
This is the third function
This is the second function

c) This is the second function
This is the first function
This is the third function

d) This is the third function
This is the first function
This is the second function

Submitted by: Murtaza
a) This is the first function
This is the second function
This is the third function
Output:
root@ubuntu:/home/google# ./test.sh
This is the first function
This is the second function
This is the third function
root@ubuntu:/home/google#
Submitted by: Murtaza

Read Online Linux OS Shell Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.