Unix Shell Variables MCQs

This section focuses on "Variable" 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. The name of a variable can contain ________.

A. numbers
B. letters
C. underscore character
D. All of the above

View Answer


2. Unix shell variables will have their names in _____.

A. Uppercase
B. Lowercase
C. First character Uppercase and all other character Lowercase
D. First character Lowercase and all other character Uppercase

View Answer


3. Whch of the following is invalid variable names?

A. VAR_1
B. _ALI
C. VAR1
D. VAR_A!

View Answer


4. Shell variables are of ____ types.

A. 3
B. 4
C. 2
D. 5

View Answer


5. Which of the following command is used to display the environment variables only?

A. sh
B. set
C. env
D. var

View Answer


6. How many prompt shell has?

A. 4
B. 2
C. 3
D. 5

View Answer


7. Which keyword is used to remove the variable?

A. remove
B. readonly
C. unset
D. delete

View Answer


8. We cannot use the unset command to unset variables that are marked ____________.

A. read
B. write
C. readonly
D. writeonly

View Answer


9. Which one of the following is not an environment variable?

A. env
B. Path
C. Home
D. User

View Answer


10. $# is used to show?

A. The number of arguments supplied to a script.
B. The filename of the current script.
C. The exit status of the last command executed.
D. The process number of the last background command

View Answer





Discussion


* You must be logged in to add comment.