OPS435: Assignment #1


This assignment consists of 2 parts (stages). The following table displays the due date and a brief description of each of these stages:



Due Date


Create a shell script that graphically prompts the user for information and then assembles and publishes a webpage. The webpage will be published in user's "public_html" directory in their Matrix account . No error-checking is required.

Friday Feb. 19th, 2010 @ 11:59:59 p.m.


To be announced...

To be announced...



You are an adminstrator of a large Linux system. One of the many duties you perform is webpage administration. One boring and repetitive task is to create webpages that show programming examples for programming students. Each webpage contains the same format. Below is a list of the webpage contents:

  • Webpage title (displayed in window titlebar) of webpage name.
  • Level One Heading displaying example title.
  • Paragraph providing brief explanation or what program does.
  • Image of screen capture showing program running. Note: source ("src") for image will be an external link (eg. src="http://.....").
  • Preformatted text showing contents of a text file (eg. c programming file, html file, etc...).
  • Second paragraph with concluding remarks

Here is a link to a sample of a typical webpage for a C Programming example: [ Webpage appearing in web-browser ] [ html code of Webpage ]

You want to assign this task to other people, but no-one else knows how to create a simple webpage. Your task is to create a portable Bash-shell script called makePage.bash that will allow non-techie employees create those type of webpages. Your shell script is designed to accept one argument, the pathname of a webpage file to be created or overwritten with new webpage content. You can assume that your instructor (when marking your assignment) will issue your script with one argument (i.e. no error checking is required).

The shell script will indicate if the file will be created, or if the file "already exists" and will be overwritten by the new webpage content. The Shell script will address the user by their full name, and then prompt the user for data (in the following order):

  1. Ask for webpage title
  2. Ask for body background color
  3. Ask for foreground text color
  4. Ask for Level One Heading text
  5. Ask for First Paragraph text
  6. Ask for image URL
  7. Indicate and allow user to select code file to select
  8. Ask for Second Paragraph text
  9. Indicate to the user that the webpage has been created and provide the full URL for user to Verify


You can assume that when marking your Assignment #1 - Stage1, your instructor will only use valid color names, and valid URL names to existing images.

Here are some other important hints or suggestions:

  • Use redirection techniques to help build a webpage. You can always build first part of webpage, and then add to the webpage as you go...
  • Store text or required data in variables so when you build webpage, you just place variable to expand within html tags.
  • For prompting user for data, color, text, etc... use command substitution to store results into a variable (see if there are samples in examples or demos on my webpage)
  • To make dialog boxes, use the "zenity" command. Refer to this link for examples how it works: [ How to Use Zenity ]
    Also, you can use the man pages to learn how the zenity command works.


Since the "Zenity" command produces a dialog box, you CANNOT run this command remotely connected from home!

Therefore, there are 2 approaches to working on this assignment:

  • Complete your assignment while at Seneca College labs (Logged into Matrix - GUI).
    This means you should complete your assignment as soon as possible!

  • Complete your assignment on a version of Linux on your desktop or notebook computer. You will need to make certain the "Zenity" command is installed on your system. When completed, you will need to sftp your script to your Matrix account for testing, and then submittal to your instructor. This means you need to complete and submit your assignment in advance!

Sample Runs (STAGE #1)

Here are a few YouTube videos to show you how this shell script will work:
(You can also view full screen, pause and play (replay) these Youtube videos)...

  • Example to same C Programming Example webpage (discussed earlier): [Video]
  • Different Example: [Video]


To Be Announced...


You MUST run the programs below to submit your assignment stages (no exceptions). The following table displays which commands to run for submitted stage1 and stage2 (when available).




Not available yet...


Not available yet...


  1. Shell scripts are to be submitted from your Matrix account from the submission scripts displayed above – no exceptions.

  2. If you do not submit your script on time, there will be a 10% penalty.

  3. Late assignments will carry a penalty of 10% per day. Since assignment is submitted electronically: weekends count!.

  4. If your script is not functional when tested, or produces too many incorrect answers, it will receive a mark of zero and must be resubmitted with in 7 days.
    Once resubmitted, such assignments can receive a maximum of 55%.

  5. Every assignment will be checked for plagiarism. If any copying is discovered, both students will receive a mark of zero and a "Dishonesty Report" will be entered in both student's files.

Good Luck :)