You are on page 1of 4

School of Computer Science Engineering and Technology

Course- MCA- Core


Course Code- CMCA505
Course Name- Operating Systems Essentials
Year- 2023-24, Semester- Even

Lab Assignment – 3: Working on Linux Shell Scripting


Submitted by – Swapnendu Let (E23MCAG0044)

Task: Design a shell script that takes a csv file of attendance record of this batch as an
input, and outputs an HTML page containing the attendance. The output HTML document
when opened in any browser should display the information in the form of a table:

Step 1: Logged in as root and changed the directory to /usr/bin

Sudo -s

Cd /usr/bin

1
School of Computer Science Engineering and Technology
Step 2: created a lab3.sh script file using vim editor

And created a script to perform the task as shown below

2
School of Computer Science Engineering and Technology

Step 3: Copied data.txt in /usr/bin

Cp data.txt /usr/bin

Step 4: Granted execution permission to lab3.sh file

Chmod 755 lab3.sh

Using execution permission now this file can be executed.

3
School of Computer Science Engineering and Technology

Step 5: executing the lab3.sh file using bash command.

Bash lab.sh <data.txt> outputnew.html

And here we can see that the file is executed as it should be.

And the new file named “outputnew.html” is generated which we have to access.

Step 6: open the browser using file:/// link pattern

File:///usr/bin/outputnew.html

You might also like