0% found this document useful (0 votes)
54 views

11th Computer CH-8

Uploaded by

Ilesh Shah
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)
54 views

11th Computer CH-8

Uploaded by

Ilesh Shah
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/ 6

Sub: Computer Std.

:11th EC

Chapter: 8Advance Scripting

8.1 Finding Process ID


Here students will know what is process in any operating system. Different
parts of process.
1. shell script has features similar to ___
A Higher level language B Lower level language
C Middle level language d None
2. the shell script can be used for ?
A. programming B. routine system administration tasks
C. higher level programming D. all of above
3. by using shell script, administrator can monitor system from ___ ?
A Internet B Nearby location
C Both a and b d Remote location
4. the shell script designed so far were ___ in nature ?
A Ascending B Descending
C Sequential d None
5. the commands were executed in ___ in which they appear in script ?
A Ascending order B Same order
C Descending order d Sequential
Finding process ID
6. in Linux all programs are stored on ___ ?
A Pen drive B Memory
C Hard disk d All of above
7. In linux all program are executed as ___
A Program B Process
C File d none
8. Each process when started has a unique number associated with it know as …..
A Memory id B Process id (PID)
C Harddisk id D All of these
9. we can perform __ operations on process ?
A View B Stop
C Both a and b d None
10. Which command is use to see the processes associated with the current shell without any
parameters ?
A Ps B Ls
C Id D Sp
11. Which command is used to view the process of all the user ?
A Ps –ef B Ps –lf
C Ps – er D Ps –er
12. Which command reads the data from the standard input device ?
A read B Translate
C convert D Interpret
13. If we remove the process then we can free ___
A Data B Memory space
C Hard disk space D All of these
14. To remove the process from memory we use the ……… command
A kill B Remove
C delete D All of these
15. Which command is used to remove PID=101 ?
A Kill -9 101 B Kill 101
C Kill -1 101 D None of these
16. Linux stores the value provided through command line in ……. Variable ?
A * B $
C # D &
17. Which command assigns the string to be read from keyboard to variable ‘name’ ?
A Read name B Readkey
C Assign name D None of these
18. $1 to $9 these arguments are known as ……..
A Command line command B Command line variable
C Command line parameters D Command line arguments
8.2 IF statement
Here students will get idea how to use decision statement (IF), types of if
statements.
19. …….. construct shell script allows to perform decision making .
A loop B If-then-fi
C while D For
20. The statement of linux is concerned with the ………. Of a expression .
A Exit status B Entry status
C (a) and (b) D None of these
21. The exit status of command is …… if it has been executed successfully .
A 1 B 0
C 3 D 4
22. The exit status of command is ……… if it has been not executed successfully.
A 1 B 0
C 3 D 4
23. In if statement ………. Bracket is use for opening and closing statements.
A ** B []
C () D {}
24. There should be …….. space after opening square bracket and one before closing bracket .
A 1 B 0
C 3 D 4
25. If the condition is evaluated to true the statements typed inside …… block will be executed otherwise
not .
A if B While
C for D Then
26. The end of the if statement is indicated by….. statement .
A fii B Fi
C then D If
27. Then keyword should be typed ………. If statement else we will get error .
A before B Up
C below D After
28. We can use the ……… decision making instructions while creating a shell script in Linux .
A 1 B 0
C 3 D 4
29. Which decision making instructions dose Linux offers ?
A If-then-fi B If-then-else-fi
C If-then-elif-else-fi & case-esac D All of these
30. Which command will be used to compare two files passed to it as argument ?
A com B Cmp
C cam D Comp
31. Linux provides _______ command , which can be used in place of square brackets.
A if B Test
C then D Else
32. The test command can carry out _________ types of tests .
A Numerical tests B String tests
C File tests D All of these
33. Which tests are used when comparison between values of two numbers is to be done
A String tests B File tests
C Numerical tests D None of these
8.3 Operators
Here students will understand different operators used in script.
34. Which operatorcan be used for numerical test for greater than ?
A -gt B -lt
C -ge D -le
35. Which operator can be used for numerical test ‘less than’ ?
A -le B -ne
C -lt D -ge
36. Which operator can be used for numerical test ‘greater than or equal to’ ?
A -gt B -ge
C -gq D -gi
37. Which operator can be used for numerical test ‘less than or equal to ‘ ?
A -la B Lq
C -el D -le
38. Which operator can used for numerical test ‘not equal to’?
A -n B -not
C -ne D -no
39. Which operator can be used for numerical test ‘equal to’ ?
A -e B -eq
C -ea D -et
40. How many relational operators are used to compare two numeric operands ?
A 4 B 6
C 3 D 4
 Logical Operators
41. To combine conditions we make use of ……… operators .
A Relational B File
C Logical D All of these
42. Shell allows usafe of _____________ logical operators while testing a condition.
A two B Three
C four D Five
43. Which logical operator allows in shell for testing a condition ?
A -a (AND) B -o (OR)
C ! (NOT) D All of these
44. Logical operator AND is displayed with ________ sign .
A -a B -e
C -0 D !
45. Logical operator OR is displayed with ________ sign .
A -a B -e
C -o D !
46. Logical operator NOT is displayed with ________ sign.
A -a B -e
C -o D !
47. Which operator is used to converts true to false and vice versa ?
A AND B NOT
C OR D None of these
File Operators
48. Which operator is used to check the status of a file ?
A relational B File
C logical D All of these
49. Which condition return True if a file with the specified name exists and has size greater than 0 ?
A -s name B -f name
C -d name D -r name
50. Which condition return True if a file with the specified name exists and is not a directory?
A -s name B -f name
C -d name D -r name
51. Which condition return True if a directory with the specified name exists ?
A -s name B -f name
C -d name D -r name
52. Which condition return True if a file with the specified name exists and the user has read permission
on it ?
A -s name B -f name
C -d name D -r name
53. Which condition return True if a file with the specified name exists and the user has write permission
on it ?
A -w name B -x name
C -d name D -r name
54. Which condition return true if file with the specified name exists and user has execute -mission on it ?
A w- name B -x name
C -d name D -r name
55. Which statements allows to test limited set of condition ?
A If-then-fi B If-then-else-fi
C (a) and (b) D None of these
56. Which statement is used to perform more number of tests ?
A If-then-elif-then-else-fi B Case
C (a) and (b) D None of these
The case statement
57. The altername option for checking if-then-elif-then-else-fi conditions is to use a …….. statement .
A For B Case
C (a) and (b) D None of these
58. All the statements written within that section are executed till ………. Are encountered .
A ? B ;;
C :: D <>
59. The end of case statement is specified by …………….. keyword.
A esac B easc
C case D None of these
60. The shell starts executing statement written ………. The end of case statement.
A before B after
C end D None of these
61. If user enter any value that dose not match any of the case value specified, then the control is
transferred to the section that has ……… as its value.
A ? B &
C * D $
62. We can assign ……. Value to the variable that accepts the choice.
A numeric B character
C string D All of these
63. In case we assign value then within the case it should be enclosed between …….quotes .
A “ “ B { }
C ‘ ‘ D * *
8.4 Handing Repetition
Students can understand how we can use loop in script like for, while and until
64. Cleaning of disk space is a normal operation that the ….. needs to perform .
A user B group
C administrator D All of these
65. the process of repeating the same commands at given number of times is known as ______.
A looking B rounding
C looping D repeating
66. Linux shell facilities _________ types of loop statements .
A two B three
C four D five
67. Which type of loop statements Linux shell provides ?
A For statement B While statement
C Until statement D All of these
Handling Repetition : for loop
68. Which loop allows us to specify a list of values in its statement ?
A For loop B While loop
C Until loop D Do while loop
69. Which loop is executed for each value mentioned in the list ?
A While loop B Do while lop
C For loop D Until loop
70. Which another activity that administrator regularly performs is taking …….. of files .
A Delete B Remove
C Backup D All of these
71. Once all files are copied , the backup directory is compressed (packed) using …….. command.
A Tar B zip
C Gz D All of these
72. which command is used to backup directory in compressed (packed) ?
A Tar –cfz B Tar -czf
C Tar –cdf D None of these
73. Which command is used to uncompress the tar file ?
A Tar –xvf B Tar -abc
C Tar –vxf D Tar -fvx
While statement
74. Which loop repeats block of commands number of times ?
A For loop B While loop
C Until loop D Do while loop
75. While loop is used to repeats the set of command specified between keywords do and done statement
as long as the condition specified as an expression is true ?
A For loop B While loop
C Until loop D Do while loop
until statement
76. The ………. Loop is similar to the while loop.
A For B Until
C (a) and (b) D None of these
77. ……. loop executes till the condition is true .
A for B until
C while D None of these
78. ………. are small subscripts within a shell script .
A Statement B Loop
C Function D None of these
79. Using the function we can improve the overall -------------------- of the script .
A readability B writing
C oral D None of these
80. The function used in shell script do not return a value ,they return a……….
A binary B Exit code
C Status code D All of these
81. ……….after a variable name indicates that it is function .
A {} B []
C () D ““

You might also like