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

UNIXANDSHELLPROGRAMMING

This document contains 8 questions related to UNIX and shell programming. The questions cover topics such as: 1. Creating directories and valid/invalid filename characters. 2. Signals, signal types, and related commands. 3. The effects of various shell commands like grep, sed, mail, cut etc. 4. Pattern matching with sed and grep. 5. Estimating file contents without opening the file. 6. What constitutes a shell script and examples. 7. Exit statuses of grep and sed commands. 8. Addressing and address ranges in sed.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

UNIXANDSHELLPROGRAMMING

This document contains 8 questions related to UNIX and shell programming. The questions cover topics such as: 1. Creating directories and valid/invalid filename characters. 2. Signals, signal types, and related commands. 3. The effects of various shell commands like grep, sed, mail, cut etc. 4. Pattern matching with sed and grep. 5. Estimating file contents without opening the file. 6. What constitutes a shell script and examples. 7. Exit statuses of grep and sed commands. 8. Addressing and address ranges in sed.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Code No: 07A3EC17 R07 Set No.

2
II B.Tech I Semester Examinations,December 2011
UNIX AND SHELL PROGRAMMING
Common to Information Technology, Computer Science And Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. Explain addressing and address ranges in sed with suitable examples. [16]

2. Define signal? What are the types of signal and give brief information about com-
mands which are used with signal? [16]

3. (a) How directories can be created? Explain the procedure for creating directories.
(b) What are the characters that should not be used in a filename? [8+8]

4. (a) When will be begin pattern true? When it is false? Explain with an example.
(b) Find the line that matches a regular expression in korn using grep. [8+8]

5. (a) Use a grep command and check its exit status. When is its result zero? When
it is non zero? Check both cases.
(b) Use a sed command and check its exit status. When is its result zero? When
it is non zero? Check both cases. [8+8]

6. (a) You are given a file myfile. Without opening this file how would you make
fair estimate about its contents.
(b) What is a shell script? Explain with suitable examples. [8+8]

7. What would be the effect of the following commands:

(a) mkdir/usr/local/src/bash/{old, new, dist, bugs}


(b) type printf
(c) echo -e ‘‘\t\tHellothere\c”
(d) echo -n “Hello there”
(e) printf -version
(f) printf “The number is %.2f\n” 100
(g) printf % s’s average was % 1f% % .\ n” “Jody” $ (( (80+70+90)/3 ))
(h) echo $ {EDITOR:=/bin/vi} [2×8=16]

8. What would be the effect of the following commands:

(a) mail user1 user2 < myprog.c


(b) wall
(c) grep ‘rao$’ xyz

1
Code No: 07A3EC17 R07 Set No. 2
(d) cut -f1,3 file1
(e) news
(f) finger -i
(g) pg xyz
(h) uniq < xyz. [16]

?????

2
Code No: 07A3EC17 R07 Set No. 4
II B.Tech I Semester Examinations,December 2011
UNIX AND SHELL PROGRAMMING
Common to Information Technology, Computer Science And Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. (a) How directories can be created? Explain the procedure for creating directories.
(b) What are the characters that should not be used in a filename? [8+8]

2. Define signal? What are the types of signal and give brief information about com-
mands which are used with signal? [16]

3. What would be the effect of the following commands:

(a) mail user1 user2 < myprog.c


(b) wall
(c) grep ‘rao$’ xyz
(d) cut -f1,3 file1
(e) news
(f) finger -i
(g) pg xyz
(h) uniq < xyz. [16]

4. What would be the effect of the following commands:

(a) mkdir/usr/local/src/bash/{old, new, dist, bugs}


(b) type printf
(c) echo -e ‘‘\t\tHellothere\c”
(d) echo -n “Hello there”
(e) printf -version
(f) printf “The number is %.2f\n” 100
(g) printf % s’s average was % 1f% % .\ n” “Jody” $ (( (80+70+90)/3 ))
(h) echo $ {EDITOR:=/bin/vi} [2×8=16]

5. Explain addressing and address ranges in sed with suitable examples. [16]

6. (a) Use a grep command and check its exit status. When is its result zero? When
it is non zero? Check both cases.
(b) Use a sed command and check its exit status. When is its result zero? When
it is non zero? Check both cases. [8+8]

3
Code No: 07A3EC17 R07 Set No. 4
7. (a) When will be begin pattern true? When it is false? Explain with an example.
(b) Find the line that matches a regular expression in korn using grep. [8+8]

8. (a) You are given a file myfile. Without opening this file how would you make
fair estimate about its contents.
(b) What is a shell script? Explain with suitable examples. [8+8]

?????

4
Code No: 07A3EC17 R07 Set No. 1
II B.Tech I Semester Examinations,December 2011
UNIX AND SHELL PROGRAMMING
Common to Information Technology, Computer Science And Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. What would be the effect of the following commands:

(a) mail user1 user2 < myprog.c


(b) wall
(c) grep ‘rao$’ xyz
(d) cut -f1,3 file1
(e) news
(f) finger -i
(g) pg xyz
(h) uniq < xyz. [16]

2. (a) When will be begin pattern true? When it is false? Explain with an example.
(b) Find the line that matches a regular expression in korn using grep. [8+8]

3. What would be the effect of the following commands:

(a) mkdir/usr/local/src/bash/{old, new, dist, bugs}


(b) type printf
(c) echo -e ‘‘\t\tHellothere\c”
(d) echo -n “Hello there”
(e) printf -version
(f) printf “The number is %.2f\n” 100
(g) printf % s’s average was % 1f% % .\ n” “Jody” $ (( (80+70+90)/3 ))
(h) echo $ {EDITOR:=/bin/vi} [2×8=16]

4. (a) How directories can be created? Explain the procedure for creating directories.
(b) What are the characters that should not be used in a filename? [8+8]

5. Define signal? What are the types of signal and give brief information about com-
mands which are used with signal? [16]

6. Explain addressing and address ranges in sed with suitable examples. [16]

7. (a) You are given a file myfile. Without opening this file how would you make
fair estimate about its contents.

5
Code No: 07A3EC17 R07 Set No. 1
(b) What is a shell script? Explain with suitable examples. [8+8]

8. (a) Use a grep command and check its exit status. When is its result zero? When
it is non zero? Check both cases.
(b) Use a sed command and check its exit status. When is its result zero? When
it is non zero? Check both cases. [8+8]

?????

6
Code No: 07A3EC17 R07 Set No. 3
II B.Tech I Semester Examinations,December 2011
UNIX AND SHELL PROGRAMMING
Common to Information Technology, Computer Science And Engineering
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
?????

1. What would be the effect of the following commands:

(a) mail user1 user2 < myprog.c


(b) wall
(c) grep ‘rao$’ xyz
(d) cut -f1,3 file1
(e) news
(f) finger -i
(g) pg xyz
(h) uniq < xyz. [16]

2. (a) How directories can be created? Explain the procedure for creating directories.
(b) What are the characters that should not be used in a filename? [8+8]

3. (a) When will be begin pattern true? When it is false? Explain with an example.
(b) Find the line that matches a regular expression in korn using grep. [8+8]

4. What would be the effect of the following commands:

(a) mkdir/usr/local/src/bash/{old, new, dist, bugs}


(b) type printf
(c) echo -e ‘‘\t\tHellothere\c”
(d) echo -n “Hello there”
(e) printf -version
(f) printf “The number is %.2f\n” 100
(g) printf % s’s average was % 1f% % .\ n” “Jody” $ (( (80+70+90)/3 ))
(h) echo $ {EDITOR:=/bin/vi} [2×8=16]

5. (a) You are given a file myfile. Without opening this file how would you make
fair estimate about its contents.
(b) What is a shell script? Explain with suitable examples. [8+8]

6. Define signal? What are the types of signal and give brief information about com-
mands which are used with signal? [16]

7
Code No: 07A3EC17 R07 Set No. 3
7. (a) Use a grep command and check its exit status. When is its result zero? When
it is non zero? Check both cases.
(b) Use a sed command and check its exit status. When is its result zero? When
it is non zero? Check both cases. [8+8]

8. Explain addressing and address ranges in sed with suitable examples. [16]

?????

You might also like