0% found this document useful (0 votes)
5 views13 pages

MCQ Module 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views13 pages

MCQ Module 5

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

CENTURION UNIVERSITY OF TECHNOLOGY & MANAGEMENT

ANDHRA PRADESH

EXAMINATION CELL

SUBJECT NAME:OPERATING SYSTEM CONCEPTS

SUBJECT CODE: CUTM1032

MODULE NO: 5
S. MCQ Image if any
NO
1 Which shell is commonly
used for scripting on Linux
systems?
A Bash YES

B Sh

C Csh

D Ksh

2 Which of the following is


NOT a valid bash variable
name?
A my_variable
B _var
C 123var YES

D myVar
3 How do you define a bash
array?
A my_array=(value1, value2,
value3)
B my_array=[value1, value2,
value3]
C my_array={value1, value2,
value3}
D my_array=(value1 value2 YES
value3)
4 Which operator is used for
arithmetic division in bash?
A / YES

B %
C *
D -
5 Which conditional
statement is used to
execute code based on a
single condition in bash?
A if YES

B elif
C else
D switch
6 Which loop statement is
used to execute a block of
code until a condition is met
in bash?
A for
B while YES

C until
D do-while
7 Which command is used to
define a function in bash?
A define
B function YES
C def
D fn
8 How do you access the nth
element of a bash array?
A my_array[n]
B my_array[n-1] YES

C my_array{n}
D my_array[n+1]
9 Which operator is used for
string concatenation in
bash?
A +
B &
C #
D : YES

10 Which conditional
statement is used to
execute code based on
multiple conditions in bash?
A if
B elif
C else
D case YES

11 Which loop statement is


used to execute a block of
code a fixed number of
times in bash?
A for YES

B while
C until
D do-while
12 Which of the following is
NOT a valid output
redirection operator in
bash?
A < YES

B >
C >>
D &>
13 Which command is used to
read input from the user in
bash?
A read YES

B input
C get
D scan
14 How do you pass arguments
to a bash function?
A By reference
B By value YES

C By pointer
D By name
15 Which operator is used to
test for string equality in
bash?
A == YES

B =
C !=

D <>
16 Which conditional
statement is used to
execute code based on a
negated condition in bash?
A if
B elif
C else YES

D unless
17 Which loop statement is
used to execute a block of
code at least once in bash?
A for
B while
C until
D Do-while YES

18 Which command is used to


display the value of a bash
variable?
A echo YES

B print
C display
D show
19 How do you delete a bash
variable?
A delete my_variable
B unset my_variable YES

C remove my_variable
D clear my_variable
20 Which operator is used for
integer exponentiation in
bash?
A ^
B ** YES

C //
D ^^
21 Which conditional
statement is used to
execute code based on a
range of values in bash?
A if
B elif
C else
D case YES
22 Which loop statement is
used to execute a block of
code until a condition is
false in bash?
A for
B while
C until YES

D do-while
23 Which of the following is
NOT a valid output
redirection operator in
bash?
A >
B >>
C < YES

D &>
24 Which command is used to
read input from a file in
bash?
A read YES

B cat
C head
D tail
25 How do you declare a global
bash variable?
A By using the -g option
B By not declaring it locally
C By using the export YES
command
D By using the global
command
26 Which operator is used to
test if a string contains a
substring in bash?
A $

B * YES

C %
D #
27 Which conditional
statement is used to
execute code based on the
exit status of a command in
bash?
A if YES

B elif
C else
D test
28 Which loop statement is
used to execute a block of
code for each item in a
bash array?
A for YES

B while
C until
D do-while
29 Which command is used to
redirect the standard output
and standard error streams
to a file in bash?
A >
B >>
C &> YES

D &>>
30 How do you pass an array
to a bash function?
A By reference YES

B By value
C By pointer
D By name
31 Which operator is used to
test for string inequality in
bash?
A ==
B =
C != YES

D <>
32 Which command is used to
write output to a file in
bash?
A write
B output
C cat with > or >> YES

D printf
33 How do you pass a variable
number of arguments to a
bash function?
A By using the shift command
B By using the $@ variable
C By using the $* variable YES

D By passing the number of


arguments as a parameter
34 Which conditional
statement is used to
execute code based on the
result of multiple tests in
bash?
A if
B elif YES

C else
D case
35 Which loop statement is
used to execute a block of
code a specified number of
times in bash?
A for YES

B while
C until
D do-while
36 Which command is used to
redirect the standard input
stream from a file in bash?
A <
B <<
C Both A and B YES

D None
37 Which conditional
statement is used to
execute code based on
multiple possible values of a
variable in bash?
A if
B elif
C else
D case YES

38 Which of the following is


NOT a valid logical operator
in bash?
A !
B &&
C ||
D <> YES

39 Which command is used to


redirect the standard output
stream to a file and append
the output in bash?
A >
B >
C >> YES

D <<
40 The redirection used for
passing one output to input
as another command is
A >
B | YES

C <
D <<

You might also like