[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 110: Undefined array key "cached"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 111: Undefined array key "normal"
[phpBB Debug] PHP Notice: in file /includes/db/dbal.php on line 112: Undefined array key "total"
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 885: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3391: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3393: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3394: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3395: Cannot modify header information - headers already sent by (output started at /includes/functions.php:2922)
Cabrillo College Linux Classes • View topic - boilerplate

boilerplate

UNIX/Linux Network Administration

boilerplate

Postby Greg Earthman on Wed May 20, 2009 6:20 pm

for the last lab we turned in, I forgot to include the boilerplate info and so to make it easier to not forget again and make it easy to fill out, I wrote a simple script to create the boilerplate info. I should have done this much earlier in the class as scripts are really good to do repetitive tasks and this was repeated for each lab.
This script takes two arguments when run: the first is the number of the lab, and the second is the number of hours that you spent on the lab. (a third argument could be added to take care of the workstation as well, but since I have done the lab at the same workstation, I just hardcoded it.)
You need to fill in your name manually but since your name usually doesn't change very often you only need to do it when setting up the script initially.

contents of the script:
#!/bin/bash

echo
echo "******************************************"
echo
echo " CIS 192 Lab $1"
echo " Name: Greg Earthman"
echo " Date: `date | cut -f 1,2,3,6 -d \" \"`"
echo " TBA hours: $2 "
echo " Station Number: CIS-Lab-08"
echo
echo "******************************************"
echo "******************************************"
echo


if you save this text in a file on your virtual machine, give it execute permission, and run it, (i named it boilerplate.sh) ./boilerplate.sh 09 4.5
will output:

******************************************

CIS 192 Lab 09
Name: Greg Earthman
Date: Wed May 20 2009
TBA hours: 4.5
Station Number: CIS-Lab-08

******************************************
******************************************

and then of course if it checks out ok, and you run it again redirecting the output to a file as such:
./boilerplate.sh 09 4.5 > lab09

the file lab09 will start with the boilerplate info you just painlessly created to which you can add the other output that you need for the lab.

Then scp that file to opus to turnin.


Greg
Greg Earthman
 
Posts: 21
Joined: Tue Nov 04, 2008 9:34 pm

Return to CIS 192 - Spring 2009

Who is online

Users browsing this forum: No registered users and 0 guests

cron