Dana Vrajitoru
C151 Multi-User Operating Systems

C151 Homework 9

Due Date: Monday, March 29, 2021.

Ex. 1. a.CGI Script

In the folder week9 in your c151 folder, make a copy of the script you created in the lab and call it hw9.sh. Modify this script to create a single html page instead of a number of them. On this page, display all the jpg images in the folder inside a table containing 2 images per row, with a width of 200 for each image. The title can be the same. You can choose to use redirection or a script argument to create the html file - just let me know which one you did in a comment.

Hint:   In bash, to test if a variable $i is even, you can do
if [ $[$i % 2] -eq 0 ] ; then
...

b. HTML File

Use the script to generate a web page called homework9.html.

c. URL

Copy the file homework9.html and the four image files to the folder public_html in your home directory and change the permissions to make them readable by everyone. If you worked on a local computer, transfer the files to your Linux account in our labs first, then move them to this folder.

In a web browser write an address that starts with
http://www.cs.iusb.edu/

Add to this address the ~ (tilde) character followed by your username. This is your home page, as seen in Lab 8.

At the end of this address add the name of the html file. For example, if the file was in my directory, its address would be
http://www.cs.iusb.edu/~dvrajito/homework9.html

You should be able to see the file with the displayed images in your browser this way from anywhere, not just locally.

Homework Submission

Upload to Canvas: The shell script that you wrote and the html file that you created. Specify the link to the file you copied to your public_html folder as an URL (http) format in the text of the submission.