Shell Programming MCQs

1.The positional parameters are______
(A). special variables and patterns
(B). pattern matching parameters
(C). special variables to read user input
(D). From the command lines, the special variables for assigning arguments
(E). None of these
MCQ Answer: d
2. The shell script is___
(A). File containing a series of commands
(B). File containing special symbols
(C). group of commands
(D). group of functions
(E). None of these
MCQ Answer: a
3. For storing the number of positional parameters, what is used?
(A). $n
(B). $*
(C). $#
(D). $2
(E). None of these
MCQ Answer: c
4. To make the scripts interactive, the ________ command is used.
(A). ip
(B). input
(C). write
(D). read
(E). None of these
MCQ Answer: d
5. The internal tool of a shell is the read command.
(A). False
(B). True
(E). None of these
MCQ Answer: b
6. With one or more variables single read statement is used.
(A). True
(B). False
(E). None of these
MCQ Answer: a
7. With an extension .sh the shell scripts are saved.
(A). False
(B). True
(E). None of these
MCQ Answer: a
8. In the separate child shell process, the shell script executes.
(A). True
(B). False
(E). None of these
MCQ Answer: a
9. With ____ first line of every shell script begins.
(A). &
(B). #
(C). $
(D). !
(E). None of these
MCQ Answer: b
10. By shell into the parameter, __ reads the first argument
(A). $1
(B). $3
(C). $$
(D). 1$
(E). None of these
MCQ Answer: a
11. In ____ as a single string, a complete set of the positional parameters is stored.
(A). $*
(B). $#
(C). $n
(D). $$
(E). None of these
MCQ Answer: a
12. We have to make it executable first by using ___, to run a script
(A). chmod +w
(B). chmod +r
(C). chmod +x
(D). chmod +rwx
(E). None of these
MCQ Answer: c
13. ____command is used to spawn a child of our own choice for running a script.
(A). sh
(B). pr
(C). ps
(D). $$
(E). None of these
MCQ Answer: a
14. For looping with a list what is used?
(A). for
(B). until
(C). case
(D). while
(E). None of these
MCQ Answer: a
15. To shift arguments left we use ____ statement.
(A). set
(B). paste
(C). cut
(D). shift
(E). None of these
MCQ Answer: d
16. For reading data from the same file containing the script, _______allows us.
(A). >>
(B). —
(C). !!
(D). <<
(E). None of these
MCQ Answer: d
17. Any of the commands using standard input takes the input from here document.
(A). False
(B). True
(E). None of these
MCQ Answer: b
18. The loop is a while loop until the loop operates with reverse logic.
(A). False
(B). True
(E). None of these
MCQ Answer: b
19. The internal command in the following is_______
(A). set
(B). expr
(C). cut
(D). Is
(E). None of these
MCQ Answer: a
20. A filename is not accepted as an argument by which command?
(A). mailx
(B). ls
(C). paste
(D). cut
(E). None of these
MCQ Answer: a
21. do and the done keyword is used by which loop statements?
(A). for
(B). while
(C). for and while
(D). case
(E). None of these
MCQ Answer: c
22. with interactive programs, the here document can also be used.
(A). True
(B). False
(E). None of these
MCQ Answer: a
23. The program is interrupted by_________ command in appropriate way.
(A). kill
(B). SIGKILL
(C). trap
(D). INT
(E). None of these
MCQ Answer: c
24. To perform a set of instructions repeatedly, Which commands are used?
(A). for
(B). for, while, until
(C). until
(D). while
(E). None of these
MCQ Answer: b
25. To change filename extensions, which command do we use?
(A). chown
(B). rename
(C). rm
(D). basename
(E). None of these
MCQ Answer: d
26. To manipulate positional parameters the shell uses which command?
(A). cut
(B). set
(C). case
(D). paste
(E). None of these
MCQ Answer: b
27. In while loop which keywords are used?
(A). do and done
(B). done
(C). then
(D).do
(E). None of these
MCQ Answer: a
28. For command substitution, with the set command which of the following symbol is used?
(A). –
(B). ??
(C). —
(D). _
(E). None of these
MCQ Answer: c

Next Operating System MCQs

Computer Science Repeated MCQs Book Download

Add a Comment