Which of the following operator is used as a shorthand for test?

Which of the following operator is used as a shorthand for test?
A. % %
B. [ ]
C. & &
D. ( )
 
Answer: b
Explanation: UNIX provides a shorthand for test i.e. [ ]. We can use this pair of rectangular brackets enclosing the expression. Thus the following two are equal,
Code:
test $x  -eq  $y
[ $x  -eq  $y ]
 

Tìm kiếm

Back
Top