1. What is the most important difference between shells:
a. They are of different environment
b. They are different command language
c. They are different positional parameters
d. They are of different shell variables
2. Command line argument is related with:
a. $1, $2…$9
b. Positional parameters
c. System variables
d. a and b both
3. Which command is used in arithmetic operations:
a. expr command
b. shift command
c. echo command
d. arith command
4. The escape sequence \033[4m] is used to:
a. Under line character
b. Mark than as bold
c. Display them in reverse video
d. None
5. Which assignment is illegal:
a. a=’ls’
b. b=’ls=l’
c. c=’1972’
d. d=’Who I grep aal’
6. The command tput is used for:
a. To display the files list of correct directory
b. Used to control the output of display
c. Same as echo command
d. Same as terminal type (tty) command
7. Which one is the carriage return:
a. /r
b. \r
c. /t
d. \t
8. Which one is back space character:
a. \b
b. /b
c. \B
d. /B
9. Which command is used to know the machine have:
a. mname
b. uname
c. home-n
d. tname
10. Which command is used to change the password:
a. setpass
b. password
c. Password
d. chgpass
11. Which command is used to lock a computer system:
a. lock
b. sys lock
c. com lock
d. ter lock
12. Which command is used to check the spelling:
a. Spell
b. Sspell
c. Check spell
d. a and b both
13. Which command is related with printer:
a. Pr
b. Prtr
c. lp
d. Ptr
14. Which one is a filter
a. awk
b. ls
c. echo
d. none
15. The use of *(asterisk) in regular expressions is:
a. The limited no. of occurrence of symbols
b. The infinite no. of occurrence of symbols
c. Either non or any no. of occurrence of symbols
d. None
16. Which of the following assignments is illegal:
a. a=’cat file’
b. a=100 b=50
c. age=50
d. all the above
17. A null variable a can be created using
a. a=
b. a=’ ’
c. a=” ”
d. all the above
18. The shell meta-character $# represents
a. No. of arguments supplied to the shell script
b. Total no. of files in the current directory
c. Total no. of users who have logged in
d. Total no. of processes running in the background
19. When we are executing a shell script the shell acts as
a. An interpreter
b. A compiler
c. An operating system
d. Non of the above
20. On executing as statement set -3+1
a. $1 would be -3
b. $1 would be-
c. $1 would be set
d. This command would result into an error
21. On executing the command shift $v
a. The positional parameters would be shifted by the value of the variable v
b. The positional parameters would be shifted by 1
c. The positional parameters would not be shifted at all
d. This command would result into an error
22. Which of the following is Not a shell keyword
a. shift
b. readonly
c. Unset
d. ls
23. To the statement read v1 v2 v3 we can supply:
a. Maximum 3 values
b. Only 1 value
c. Exactly 3 values
d. Any number of values
24. The metacharacter $* represents
a. No. of parameters supplied at the command prompt
b. Parameters supplied at the command prompt
c. All files in the current directory
d. None
25. A shell variable cannot start with:
a. An alphabet
b. A number
c. A special symbol other than an underscore
d. Both b and c
26. Which of the following shows the correctly hierarchy of arithmetic operations in shell:
a. ( ), ^, * or /, + or –
b. ( ), ^, *, /, +, –
c. ( ), ^, /, *, +, –
d. ( ), /, % or *, - or +
27. Which of the following statement is correct
a. a=expr $b+$c
b. a=expr ‘$b*$c’
c. a=’expr $b*($c+$d)’
d. a=’expr $b/*($c+$d)’
28. Which of the following is allowed in an arithmetic statement involving expr instruction:
a. [ ]
b. { }
c. ( )
d. None of the above
29. The statement z=’expr 5/2’ would store in z a value
a. 2.5
b. 3
c. 2
d. 0
30. The expression, expr -7%2 evaluates to
a. 1
b. -1
c. -3.5
d. 0
31. The expression, expr -2%7 evaluates to:
a. 2
b. -2
c. 0
d. 0.285
32. Hierarchy decides which operator:
a. Is most important
b. Is used first
c. Is fastest
d. Operations on largest no.
Answers:
1. b 2. d 3. a 4.b
5. d 6. b 7. b 8. a
9. c 10. b 11. a 12. d
13. c 14. a 15. c 16. a
17. a 18. a 19. a 20. a
21. a 22. d 23. c 24. b
25. d 26. a 27. c 28. c
29. a 30. b 31. b 32. b
No comments:
Post a Comment
Open Researcher and Contributor ID (ORCID)