You are on page 1of 2

MANIPAL CENTRE FOR INFORMATION SCIENCE REG.

NO: Subject: Linux and Scripting Languages Duration: 90 Minutes Class: MSc Tech (EMB A) Marks: 50 1. List three major differences between Linux commands and Windows programs. [3 Marks] 2. Give two reason to use shell scripting. [2 Marks] 3. Compare Absolute path and Relative path with relevant example. [5 Marks] 4. List out the different ways to debug the shell script. [2.5 Marks] 5. Write a shell scripts to a. to display the message Good Morning"/"Good Afternoon"/"Good Evening" depending upon the time. [5 Marks] b. To reads a number in units of seconds and converts it to the units hours:minutes:seconds and prints the result to standard output. Your script must prompt for re-input if a negative value is input [5 Marks] c. To create user account if already there dont create otherwise create it, [2.5 Marks ] check whether user entered integer or string or empty. [5 Marks] d. To find whether given file exist or not, file name is supplied as command line argument, also check for sufficient number of command line argument [5 Marks] [P.T.O]

6. Write a shell script using GREP command

[10 Marks]

Pick all the lines that are less than 200 characters in length. Pick the lines that match exactly one character. Count total number of blank lines in the file. List all files whose 2nd letter is e List all the lines in the file that contain the pattern $ Count total number of lines that begin with a vowel. Pick only the word in double quotes Find the lines which start with an integer and end with a word. display all lines that contain #!/bin/bash in any file in the directory /Msctech/scripting j. count the number of files excluding the directories in your present directory. 7. Write a shell command to do the following [5 Marks ] a. To re-run the last command b. To count total number of files/directories starts with a c. To create a alias for displaying date in the format- dd/mm/yy d. To List all the files in your directory in long format saving the output in a file called all_my_files e. Assign the read and write permission to the owner and the read permission to

a. b. c. d. e. f. g. h. i.

the group and others.

You might also like