NEW
Font size
WorksheetsPOPQuiz-BashShell
Total questions: 12
Worksheet time: 6mins
To change mode of myfile to 'rwxr–r–' , the command used is
Chmod(myfile,0742).
Chmod(myfile,0474).
Chmod(myfile,0747).
Chmod(myfile,0744)
How can you get/set an environment variable from a program?
Getenv() and putenv()
Getenv() and setenv()
Readenv and putenv()
Readenv() and setenv()
How do you find out what’s your shell?
Whomami
Pwd
Echo $SHELL
$sh
A comment line in a script begins with
#
$
^
&
Which of the following symbols is used as prefix to access the value of variables in scripting
#
$
^
&
How can you append the output of a command to a file?
Command > file
Command >> file
Command <> file
Command < file
Which of the following is not a kind of shell
bash
ksh
csh
dsh
How do you delete a file?
Rm filename
Dl filename
Touch filename
Less filename
[ is equivalent to
test
for
while
then
In Shell scripting What does does $? Return?
$? will return exit status of command .0 if command gets successfully executed ,non-zero if command failed.
$? will return exit status of command .Non-0 if command gets successfully executed ,zero if command failed
System error
Invalid command
How do you read arguments in a shell program?
$0 would be the first line argument, $1 would be the Second command line argument, $2 the Third, and so on
$1 would be the first command line argument, $2 the second, and so on $0 is the name of the script or function
above are correct
above are incorrect
How do you get all files with on the 3rd place an r, g or i?
Ls ?3[rgi]*
Ls [rgi]
Ls [..i*]
Ls ??[rgi]*
