thedonproject
coding / Unix Shell Scripts: Cool

I took a class in the mid-90's that was supposed to be an intro to computing class or something. Some class that could be used to fulfill a general requirement for my degree. We learned some C++ and a bunch of Unix stuff that I haven't really used since, so I don't remember any of it. Here's a script I wrote for this class that I found on an old computer. I don't have a UNIX system to run it on, but I think you get the picture by reading the source code.


# cool
# this is a test to see if you are cool
# by asking a simple question
echo "this is a test, it is only a test"
echo "_________________________________"
echo ""
echo "which of the following best describes you"
echo "a) really spiffy"
echo "b) really dorky"
echo "c) really normal"
echo "d) really not like the above three"
echo -n "well? "
set ans = "$<"
if ( "$ans" == a ) then
  set score = "-200"
  echo "your score is: "$score""
  echo "you think too much of yourself..."
else if ( "$ans" == b ) then
  set score = "100"
  echo "your score is: "$score""
  echo "it's pretty cool to be dorky."
else if ( "$ans" == c ) then
  set score = "0"
  echo "your score is: "$score""
  echo "normal is very dull..."
else 
  set score = "200"
  echo "your score is: "$score""
  echo "you are amazingly cool because you are"
  echo "so special (or you typed a choice that"
  echo "is unavailable...)"
endif
echo ""
echo "thanks for taking the test, we will now"
echo "return to the show already in progress."