a) let
b) get
c) set
d) none of the mentionedAnswer: a
Clarification: None.
2. Which expression use the value of the enclosed arithmetic expression?
a) $(())
b) $()
c) ${}
d) $[].
Answer: a
Clarification: None.
3. If a and b are 2 variables then the meaning of a<<=b is
a) b = a << b
b) a = a << b
c) b = b << a
d) a = a << b
Answer: b
Clarification: None.
4. Which one of the following is bitwise ‘exclusive or’ operator?
a) ^=
b) |=
c) !=
d) none of the mentioned
Answer: a
Clarification: None.
5. Which one of the following is not a valid operator in bash shell?
a) ||
b) ~
c) =<<
d) -=
Answer: c
Clarification: None.
6. What is the output of this program?
-
#!/bin/bash
-
a=2
-
b=4
-
let c=a**b
-
echo $c
-
exit 0
a) 8
b) 16
c) 32
d) none of the mentioned
7. What is the output of this program?
-
#!/bin/bash
-
a=10; b=20
-
c=$((++a))
-
let a=c+a
-
echo $a
-
exit 0
a) 21
b) 22
c) program will generate an error message
d) none of the mentioned
8. What is the output of this program?
-
#!/bin/bash
-
a=10
-
b=$(( $a<0?10:$a<100 ))
-
echo $b
-
exit 0
a) 10
b) 20
c) 1
d) 0
9. What is the output of this program?
-
#!/bin/bash
-
a=10
-
b=$(( $a<0&&$a<100 ))
-
echo $b
-
exit 0
a) 10
b) 0
c) 1
d) none of the mentioned
10. What is the output of this program?
-
#!/bin/bash
-
a=1; b=2; c=3
-
d=$(( ++a**b*c++ + a ))
-
echo $d
-
exit 0
a) 14
b) 12
c) program will generate an error message
d) none of the mentioned