Unix Shell Operators MCQs

Shell Operators MCQs : This section focuses on "Operator" in Shell Progamming in Unix. These Multiple Choice Questions (MCQ) should be practiced to improve the unix skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.

1. Which of the following operator is not supported in Bourne shell?

A. Arithmetic Operators
B. Boolean Operators
C. Character operators
D. File Test Operators

View Answer


2. Which external program used by bourne shell to perform simple arithmetic operations?

A. awk
B. expr
C. sum
D. Both A and B

View Answer


3. The complete expr and awk expression should be enclosed between ___________.

A. ()
B. " "
C. ' '
D. < >

View Answer


4. In relational operator, which keyword is used to represent greater than or equal?

A. -eq
B. -gte
C. -ge
D. -gt

View Answer


5. Which of the boolean operator is supported in bourne shell?

A. and
B. or
C. not
D. All of the above

View Answer


6. What is the use of str operator in bourne shell?

A. Checks if str is not the empty string
B. Checks if the given string operand size is non-zero
C. Checks if the given string operand size is zero
D. Checks if the value of two operands are equal or not

View Answer


7. Which File test operator is used to checks if file has its sticky bit set?

A. -g
B. -k
C. -p
D. -a

View Answer


8. What is the used of -x file test operator?

A. Checks if file is executable
B. Checks if file has size greater than 0
C. Checks if file exists
D. Checks if file has its Set User ID (SUID) bit set

View Answer


9. What is the use of -z string operator in bourne shell?

A. Checks if the value of two operands are equal or not
B. Checks if the given string operand size is zero
C. Checks if str is not the empty string
D. Checks if the given string operand size is non-zero

View Answer


10. What is the use of -e file test operator in korn shell?

A. Checks if file is a directory
B. Checks if file is an ordinary file as opposed to a directory or special file
C. Checks if file exists
D. Checks if file is executable

View Answer





Discussion



* You must be logged in to add comment.