This document contains Frequently Asked Questions, which are relevant to completing the week's lab assignment. Any Questions may be posted to cspp51081.
Exercise 1: We will have several C files (ending in '.c'), and will expect that
when we run your shell script on the command line
% ex1
the files will be correctly changed: with "stdio.h" replaced by "STDIO.h".
Exercise 2: You will need an awk script file (this simply means a file written
for awk to read, and requires nothing special on your
part), which we will test by running:
% awk -f ex2.awk normal.precip.txt
The normal rainfall for Alaska is XX.XX
The normal rainfall for California is XX.XX
The normal rainfall for Texas is XX.XX
Your script does not need to reproduce this text exactly, but must identify the state and the
correct rainfall.
If you plan on writing versions of the exercise which are more robust (as explained above), you
only need to submit two script files ex1
and ex2 plus a document entitled
README to explain the correct commandline
syntax and what your script does.
Exercise 1: Your script will need to take a command line argument specifying
the files to be changed (this will be input by the user.) For example,
% ex1 *.c
Exercise 2: You will probably want to implement
ex2 as a shell script, since
it will need arguments supplied by the user. For example
% ex2.awk CA JAN
The normal rainfall for CA in the month of JAN is XX.XX
The exact output is up to you but it must identify the state and month.