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

Lab Assignment-2 - DOS

Uploaded by

gudulabanshika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lab Assignment-2 - DOS

Uploaded by

gudulabanshika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Laboratory Assignment 2

Subject: Design Principles of Operating Systems


Subject code: CSE 3249

Assignment 2: Familiarization with basic Commands in Unix Operating


System and Shell Programming

Objective of this Assignment:


 To learn basic concepts of shell programming
 To lean concept of command line argument in shell script.

1. Write a shell script named as prog for merge the content of files a.txt, b.txt, and c.txt
sort them and save the result in a file called result and display the sorted output on the
screen.
(Note: a.txt, b.txt and c.txt file contain some numerical value. Make the script an
executable file and run it as a command using its name only.)

2. Write a shell script named as systeminfo that will display the information about the login
name of the user, name of the Unix system used by the user, type of the SHELL, Path of
current working directory of the user and list of file contain in current working directory.
(Make the script an executable file and run it as a command using its name only.)

3. Write a shell script named as dtcal for displaying both the system date and calendar for
specific month, say march 2022, in the given format:-
Date : specific date
Calender : current calendar
(Make the script an executable file and run it as a command using its name only.)
4. Write a shell script named as nvwc which will display the filename and linecount,
wordcount and char count of the file dtcal in the following format:
Filename: dtcal
Line count: -
Word count: -
Charcout: -
(Make the script an executable file and run it as a command using its name only.)
5. Write a shell script named as nvwc2 which will display the filename and linecount, word
count and char count of any file given as argument to nvwc2 in the following format:
filename linecount wordcount charcount
file1 - - -
(Make the script an executable file and run it as a command using its name only.)

6. Write a shell script named as darg to display the total number of command line
arguments along with the first two arguments.
-Modify the script to display all the arguments.
(Make the script an executable file and run it as a command using its name only.)

7. Write a shell script named as ndisp that will take three command line arguments
specifying the value of n, m and a filename and display the first n number of lines and
last m number of lines of the file given as argument.
(Make the script an executable file and run it as a command using its name only.)

You might also like