Linux OS Shell Question:
Download Questions PDF

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

Answer:

a) 0
1

Download Linux Shell Interview Questions And Answers PDF

Previous QuestionNext Question
The statement z = 'expr 5 / 2′ would store which of the following values in z?
a) 0
b) 1
c) 2
d) 2.5
e) 3
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