Linux OS Shell Question:
Download Questions PDF

What is the output of the following program?

x = 3; y = 5; z = 10;
if [( $x -eq 3 ) -a ( $y -eq 5 -o $z -eq 10 )]
then
echo $x
else
echo $y
fi
a) 1
b) 3
c) 5
d) Error

Linux Shell Interview Question
Linux Shell Interview Question

Answer:

b) 3

Download Linux Shell Interview Questions And Answers PDF

Previous QuestionNext Question
What is the output of the following program?

[ -n $HOME ]
echo $?
[ -z $HOME ]
echo $?
a) 0
1
b) 1
0
c) 0
0
d) 1
1
The expression expr -9 % 2 evaluates to:
a) 0
b) 1
c) -1
d) 2