Sunday, June 03, 2007

Here's my brothers latest status update

Dear Friends and Family,

I'm on my third major rewrite of the outline. (The last one scrapped just about everything I wrote). The outline is about three pages, so I can't view it all at once on my screen, thus defeating it's usefulness. During the last rewrite, I simplified it to fit on one screen, but to do so I left out important details. This time I'm scripting it like I did for my website. In this manner, I can have a file for each chapter. The script that calls the files then displays only the titles and first level of detail. This manages to fit on one screen (albeit barely).

While working with the outline script I wrote a function that converts numbers into roman numerals. I was thinking about counters and I came up with the following...

bottles=99;
while [ ${bottles} -gt 1 ]; do
echo "${bottles} bottles of beer on the wall, ${bottles} bottles of beer.";
echo -n "Take one down, pass it around, ";
bottles=`expr ${bottles} '-' 1`;
done;
echo "1 bottle of beer on the wall, 1 bottle of beer.";
echo "Take one down, pass it around, no more bottles of beer on the wall."

With the semicolons, this can actually be run as a single line on a unix prompt. I put it on several lines here hoping someone will figure out what it does without an explanation.

1 comment:

TekEmperor said...

I fixed the script since then. The printed copies should reflect the accurate lyrics.