Unit - I: Unix and Shell Programming
Unit - I: Unix and Shell Programming
Subject with Code : USP (13A05503) Course & Branch: B.Tech - CSE
Year & Sem: III-B.Tech & I-Sem Regulation: R13
UNIT –I
1. (a) Describe in detail about the structure of UNIX. 5M
(b) How can you say that Unix operating system provides more security than other operating
systems? 5M
2. What information is presented when the following commands are entered? 5*2=10M
(a) date (b) who (c) passwd (d) bc (e) script
3. (a) Define vi Editor and explain its modes. 5M
(b) Brief about the commands used in the vi Editor. 5M
4. What are the file types available in Unix? Discuss file operators with suitable examples. 10M
5. (a) Explain the security levels provided in Unix environment. How to change permissions of a file?
6M
(b) Brief umask command. 4M
6. What is user and group in Unix? Explain the related commands for changing ownership and group.
10M
7. Write about the operations unique to directories alone. 10M
8. Write about the operations that can be performed on both directories and file. 10M
9. What is meant by path and pathname in Unix? Explain them in detail. 10M
10. a) Distinguish between time – sharing and client/server environment. 2M
b) Name the two categories of regular files. Does UNIX recognize the difference between these two
categories? Explain your answer. 2M
c) Write syntax for changing ownership and group name on a given file/s 2M
d) Discuss about various modes of vi editor. 2M
e) Write the command for the following 2M
i. To display time in GMT
ii. To display time in format hour:minute:second
UNIT 2
UNIT 3
UNIT 4
UNIT 5
Subject with Code : USP (13A05503) Course & Branch: B.Tech - CSE
Year & Sem: III-B.Tech & I-Sem Regulation: R13
UNIT – I
Unit-II
UNIT III
1. Communication utilities include [ ]
A. talk B. write C. mail D. All the above
2. _____ and ____ deal with communication between two users at difference terminals. [ ]
A. telnet and ftp B. telnet and mail C. tail and write D. mail and telnet
3. To allow the write message, use the ______ command [ ]
A. mesg y B. mesg n C. mesg D. all the above
4. ____ is a utility that allows a user to log into a remote computer. [ ]
A. login B. telnet C. mail D. sign in
5. A mail address is made up of two parts _____ @ ______ [ ]
A. local address @ domain address B. local address @ portal address
C. portal address @ domain address D. domain address @ local address
6. Which mail command is used for displaying send mail commands? [ ]
A. ~?: B. ~? C. ~ D. ~!
7. ftp is a _____ standard for coping a file from one computer to another. [ ]
A. UDP B. TCP/IP C.UNIX D. none
8. ______ commands are used to transfer files. [ ]
A. get and put B. gets and puts C. open and close D. none
9. The prompt in the read mode is ______ [ ]
A. $ B. # C. % D. &
10. Which of the following are ftp commands? [ ]
A. form B.mls C. size D. all the above
11. In the vi / ex editor, you are in the ex mode only when you can see a _____ on the status line
[ ]
A. $ B. : C. ; D. ~
12.A ____ is a section of text between two points. [ ]
A. start and stop B. text object C. char object D. start and end
13. Which is not a screen cursor moves? [ ]
A. H B. L C. M D. C
UNIX AND SHELL PROGRAMMING Page 10
QUESTION BANK 2016
Unit-IV
13. The print command automatically _________ after the last argument. [ ]
A. adds zeros B. adds a terminating new line
C. adds a terminating command D. none
14. The shell uses ________________ when no specific i/p var is specified for user i/p. [ ]
A. reply B. variable C. open cmd D. all above
15. Match the setting and unsetting variables. [ ]
1. set a) set
2. unset b) var=value
3. display one c) unset var
4. display all d) print $var
A. 1.a 2.c 3.d 4.b B. 1.a 2.b 3.c 4.d C. 1.b 2.c 3.d 4.a D. 1.a 2.d 3.b 4.c
16. The ___________ prompt is used whenever a command is not completely coded on the first line.
A. directory B. secondary C. third D. fourth [ ]
17. ____________ are used to change the meaning of chars in the ksh. [ ]
A. backslash B. double quotes C. single quotes D. all above
18. When the ___________ option is off, the list file command used wildcards to match the files in a
directory. [ ]
A. noclobber B. noexec C. noglob D. all above
19. Absolute pathname for the user’s mailbox [ ]
A. MAIL B. MAILCHECK C. MAILPATH D. MAIL ABPATH
20. Command execution is carried out in _________ sequential steps. [ ]
A. 6 B. 5 C. 3 D. 8
21. The positional parameters receive their values from the ______________ [ ]
A. command-line-arguments B. prompts C. line editor D. all above
22. The _________ command, is used to evaluate a relational expression. [ ]
A. eval B. test C. tee D. ere
23. The double semicolon is needed to terminate each section of a _________ command. [ ]
A. if B. if-else C. case D. all above
24. Use the select loop only when you need to create and process ____________ [ ]
A. loops B. menus C. operations D. all above
25. There are only ___________ relational operations for strings. [ ]
A. 4 B. 6 C. 2 D. 8
26. Use the __________ command to make a script executable before executing it. [ ]
A. exec B. chmod C. chgroup D. let
27. 1) $* crates are string 2) $@ creates a list of strings. [ ]
A. only 1 is true B. only 2 is true C. both 1 & 2 are trueD. both false
28. Use the _______ and ________ options to debug your script when testing does not generate the
desired result. [ ]
A. verbose & xtrace B. set sunset C. get & set D. none above
29. The korn shell contains only ______ accessible positional parameters. [ ]
A. 9 B. 12 C. 7 D. 17
30. Only integral values can be used with the __________ command. [ ]
A. set B. let C. get D. all above
31. [a-z A-Z] pattern, means [ ]
UNIX AND SHELL PROGRAMMING Page 13
QUESTION BANK 2016
Unit-V
1. The __________ command terminates the script and sets the exit status [ ]
A. kill B. stop C. exit D. turnoff
2. ________ are a sequence of operators and operands that reduces to a single value. [ ]
A. expressions B. line C. statements D. all above
3. In the c shell, the interpreter designator line _____________ must be the first line of a script.
[ ]
A. #include<stdio.h> B. #!/bin/csh C. #/bin/csh D. #include/bin/csh
4. A ________ is needed to terminate each section of a switch statement [ ]
A. break B. breaksw C. break switch D. breakswitch
5. Use ____________ at the command line to debug script when testing does not generate the desired
result. [ ]
A. verbose and expose B. –v and -e C. –v and -x D. none
6. The ______________ statement uses the exit status of a command to make a decision. [ ]
A. if-then-else B. switch statement C. while D. none
7. The _________ statement loops a specified no of times. [ ]
A. call B. again C. repeat D. again
8. The ____________ statement rates as long as there are elements in the list. [ ]
A. repeat B. while C. forall D. foreach
UNIX AND SHELL PROGRAMMING Page 14
QUESTION BANK 2016
A. one for the system and one personal B. one boot strap and one opened file
C. operand file D. none
28. The personal shutdown file _______ is used for operations such as critical file backup [ ]
A. ~/.logout B. ~/$logout C. /.logout D. ./$logout
29. Ignore eof, disallows _________ to exit the shell. [ ]
A. ctrl + z B. ctrl + c C. ctrl + d D. none above
30. The ________ variable holds the description for the terminal we use. [ ]
A. tty B. TERM C. SHELL D. VAR
31. % set x=23 [ ]
%set y=x
%eval echo \$$y
Output will be
A. 23 B. x C. $y D. none
32. The generic terminal file is owned by [ ]
A. user B. group user C. root D. none
33. Commands are combined in ______ ways [ ]
A. 4 B. 3 C. 2 D. 1
34. _________ is not supported in the c shell. [ ]
A. ctrl statements B. loop statement C. command – line editing D. all above
35. The value of a variable in always _______ [ ]
A. string a class B. integer C. predefined data D. none above
36. Arrays in awk are called associative arrays because awk uses _______ as array indexes.
[ ]
A. variables B. index C. strings D. global variables
37. an action is one or more statements associated with a _______ [ ]
A. line B. pattern C. array D. string
38. An awk section consist of ________ [ ]
A. preprocessing B. body C. predefined data D. all above
39. A _______ is a unit of data that has informational content. [ ]
A. field B. record C. field buffer D. record buffer
40. At the end of the field specification is the _______ [ ]
A. precision B.flag C. format string D. conversion code.
OBJECTIVE - ANSWERS