CST 8177 - Lab 10

Working with variables

Student Name

Student number

Lab section:




Objective

To practice problem-solving skills with several small scripts and their PDL, Data Dictionary (where necessary), and so on. Note: Print out your finished PDL, scripts , and test output to include in your Lab Book.

In-Lab Demo-- Demo one script from this lab, explaining its behaviour.

Working with variables

Note: For each script, you need to first write PDL and a brief Test Plan before you begin to write the bash commands.

Part 1: Sourcing a variable from a configuration file

Create a short script that sources a variable from a configuration file, first writing the PDL and then the bash commands.

INIT=/etc/init

source ./sourcit.conf or . ./sourcit.conf

Test it thoroughly, with good input and bad.

Part 2: Updating a variable

Create a short script that sources a variable from a configuration file and adds the content to the PATH. As before, write the PDL first and then the bash script.

Test it thoroughly, with good input and bad.