Professional Documents
Culture Documents
Unit 4 Objective Questions
Unit 4 Objective Questions
a) group of commands
b) a file containing special symbols
c) a file containing a series of commands
d) group of functions
a) True
b) False
a) True
b) False
a) &
b) !
c) $
d) #
5) To run the shell script, we should make it executable first by using _____
a) chmod +x
b) chmod +r
c) chmod +w
d) chmod +rwx
6) To spawn a child of our own choice for running the script, we can use ___ command.
a) ps
b) pr
c) sh
d) $$
a) ip
b) input
c) read
d) write
a) True
b) False
a) True
b) False
11) The first argument is read by the shell into the parameter ___
a) 1$
b) $3
c) $$
d) $1
12) The complete set of positional parameters is stored in ______ as a single string.
a) $n
b) $#
c) $*
d) $$
13) Which of the following is used for storing the number of positional parameters?
a) $n
b) $#
c) $*
d) $2
14) Which of the following operators are used for logical execution?
a) ||
b) &&
c) %%
d) && and ||
15) When we use &&, the second command is executed only when first succeeds.
a) True
b) False
a) True
b) False
18) To perform decision depending on the fulfillment of certain criteria, ____ is used.
a) if
b) else
c) for
d) if and else
a) else
b) fi
c) if
d) else if
20) To check more than two conditions, ___ is used with if-else statements.
a) while
b) for
c) elif
d) for
a) $1
b) $0
c) $#
d) $*
22) Which of the following is not a special parameter used by the shell?
a) $$
b) $*
c) $?
d) $-
a) $$
b) $*
c) $?
d) $-
24) ____ statement matches an expression for more than one alternative.
a) for
b) while
c) elif
d) case
a) ;
b) :
c) ;;
d) //
a) True
b) False
27) The ___ option in case statement matches any option not matched by the previous options.
a) ^
b) $
c) *
d) //
a) True
b) False
a) expr
b) case
c) if
d) read
a) internal
b) external
c) shell
d) derived
a) 2
b) 4
c) 5
d) 3
33) Which of the following commands let us perform a set of instructions repeatedly?
a) for
b) while
c) until
d) for, while, until
a) do
b) done
c) then
d) do and done
35) until loop operates with a reverse logic as used in while loop.
a) True
b) False
36) Which of the following loop statements uses do and done keyword?
a) for
b) while
c) case
d) for and while
a) <
b) <<
c) >
d) >>
38) We can use the here document with interactive programs also.
a) True
b) False
39) Which command is used by the shell for manipulating positional parameters.
a) set
b)cut
c)case
d) paste
a) cut
b) expr
c) set
d) ls
41) The _________ allows us to read data from the same file containing the script.
a) >>
b) <<
c) !!
d) __
42) Any command using standard input can take the input from here document.
a) True
b) False
a) kill
b) SIGKILL
c) INT
d) trap
a) True
b) False
45) The file(or stream) representing input, which is connected to the keyboard is called
________
a) Standard output
b) Standard input
c) Standard error
d) Standard File
46) All commands displaying output on the terminal write to ________ file.
a) Standard input
b) Standard output
c) Standard error
d) Standard File
a) 0
b) 1
c) 2
d) 3
48) _______ command can be used to convert its arguments to positional parameters.
a) wait
b) sleep
c) set
d) trap
49) The statement z = ‘expr 5 / 2’ would store which of the following values in z?
a) 0
b) 1
c) 2
d) 2.5
c) Command interpreter
d) Command compiler
a) 0
b) 1
c) 2
d) 3
a) 0
b) 1
c) 2
d) 3