wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PJP - Shell Scripting

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.
_______ is an Interpreter which interprets user's instruction and send it to _______
a)
Shell,Interpreter
b)
Shell,Kernel
c)
Kernel,Shell
d)
Interpreter,Shell
2.
In Shell ______ represents home directory of a user
a)
~
b)
&
c)
#
d)
$
3.
sh is the short form of which shell?
a)
Bash
b)
C
c)
Korn
d)
Bourne
4.
Which of the following is not the execution method of shell scripting
a)
sh filename.sh
b)
./filename.sh
c)
&filename.sh
d)
filename.sh
5.
Shebang Statement is mandatory if the rest of the scripts are going to be interpreted by the default shell
a)
true
b)
false
6.
What are the two types of variables in shell scripting?
a)
Environment,User Defined
b)
System ,User Defined
c)
System,Data Type
7.
What will be the output of the below program: a=20<br />echo $a<br />unset a<br />echo $a
a)
20,Nothing will be displayed
b)
20,20
c)
20,Error
d)
20,TWENTY
8.
A Script can accept the value directly as a _______
a)
CLI
b)
CLE
c)
CLA
d)
CIL
9.
Which built-in variable will Expands to the number of positional parametere
a)
$?
b)
$#
c)
$@
d)
$*
10.
\* arithmetic operator is used for ___________
a)
Addition
b)
Multiplication
c)
Division
d)
Modulus
11.
"-eq" is compring two numbers and "=" is comparing two strings, Is the statement correct or not
a)
true
b)
false
12.
Controlling the flow of loop or script using________
a)
Loop
b)
Program Constructs
c)
Continue
d)
Wild Card Characers
13.
Which Loop can repeat execution of block of statements finite or infinte times based on the requirement
a)
while
b)
elif
c)
if
d)
for
14.
Check whether the Syntax of until is correct or not: until TEST-COMMAND:<br />do<br /> CONSEQUENT-COMMANDS;<br />done
a)
true
b)
false
15.
Which of the following is the correct form of Shebang Statement?
a)
#$/bin/bash
b)
#&bin/bash
c)
!#/bin/bash
d)
#!/bin/bash
16.
What is the Function of PS1 Variable
a)
Stores log-in Shell
b)
Stores Secondary Command Prompt
c)
Stores Primary Command Prompt
d)
Stores the terminal type
17.
What does export command does in Shell Scripting
a)
Makes the Variable Private
b)
Makes the Variable Global
c)
Retrieves the value
d)
Moves back to previous shell
18.
Predict the output of the below shell script. <br />x=10<br />y=10<br />[$x -eq $y]<br />echo $?
a)
0
b)
1
c)
2
d)
Error
19.
What is Shell in UNIX
a)
Interface between Kernel and Hardware
b)
Command Compiler
c)
Command Interpreter
d)
Takes care of Storing Files
20.
What will be the output of the below program echo -e Hello \nWorld
a)
Hello nWorld
b)
HelloWorld
c)
Error
d)
Hello \n World