You are on page 1of 7

3/22/2021 Free Open Source Software (Mid Term 2)

Free Open Source So ware (Mid Term 2)


Total points 9/15

Email address *

arifmohammadarif0786@gmail.com

Which of the following keywords are used in while loop? * 0/1

done

do

then

do and done

Correct answer

do and done

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 1/7
3/22/2021 Free Open Source Software (Mid Term 2)

What does -c option do in the grep command? * 0/1

matches either uppercase or lowercase

prints the line that don't match the pattern

prints the matched line and its line no.

print count of matching lines

Correct answer

print count of matching lines

Which option will e used to replace the nth occurrence of a pattern in a 0/1
file? *

$sed 's/unix/linux/n' filename.txt

$sed 's/unix/linux/g' filename.txt

none of the above

$sed 'n s/unix/linux/' filename.txt

Correct answer

$sed 's/unix/linux/n' filename.txt

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 2/7
3/22/2021 Free Open Source Software (Mid Term 2)

To write selected lines, ____ is used with sed. * 0/1

Correct answer

Which of the following is used for storing the number of parameters 1/1
given as argument while running the shell script? *

$*

$#

$@

$n

Which one of the following command is used for searching for a pattern 1/1
in one or more file(s)? *

find

grep

cd

cp

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 3/7
3/22/2021 Free Open Source Software (Mid Term 2)

Which symbol will be used with grep command to match the pattern at 1/1
the beginning of the line *

Suppose x =10, then what will be the value of x$x$? * 1/1

x10$

error

undefined

100

test -r filename -a -w filename * 1/1

None of the above

File is both readable and writable

File is readable only

File is writable only

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 4/7
3/22/2021 Free Open Source Software (Mid Term 2)

To run the script, we should make it executable first by using _____ * 0/1

chmod +x

chmod +rwx

chmod +w

chmod +r

Correct answer

chmod +x

To delete a line using sed, which of the following option is used? * 1/1

none of the above

Full Name *

Mohammad Arif

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 5/7
3/22/2021 Free Open Source Software (Mid Term 2)

Which command is used for making the scripts interactive? * 1/1

read

ip

write

input

Which is the correct syntax for using sed ? * 0/1

sed 'action' file(s)

none of the above

sed option 'action'

sed option 'address action' file(s)

sed options file(s)

Correct answer

sed option 'address action' file(s)

Full Roll No. *

52010006

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 6/7
3/22/2021 Free Open Source Software (Mid Term 2)

Which of the following command is used with sed for outputting as well 1/1
as printing the selected lines? *

If there are special characters in a pattern, then we’ve to enclose them in 1/1
______ *

double quote

without any quote

all quotes

single quote

This form was created inside National Institute of Technology, Kurukshetra.

 Forms

https://docs.google.com/forms/d/e/1FAIpQLSdrIp4vhpB3yLURX8n2j9swuUSh1Xm5efQVLy21iE3Rt_4vzg/viewscore?viewscore=AE0zAgCV5UU2LdW… 7/7

You might also like