All pastes #1700505 Raw Edit

Miscellany

public text v1 · immutable
#1700505 ·published 2009-12-03 18:16 UTC
rendered paste body
#!/bin/bash

while [ true ]
do
 echo "Welcome to Shaun's collection."
 echo "Please type in the corresponding number."
 echo "1. View the collection."
 echo "2. View the cd's from a certain artist."
 echo "3. View the cd's purchased on a specific date."
 echo "4. View the total cost of the collection."
 echo "5. Exit"
 read number
 if [ $number = 1 ]
 then
  cat shaun_kasiram_music
 elif [ $number = 2 ]
 then
  echo "please type in artists name"
  read artist
  egrep -i "$artist" shaun_kasiram_music
 elif [ $number = 3 ]
 then
  echo "please type in a date"
  read date
  egrep -i "$date" shaun_kasiram_music
 elif [ "$number" = 4 ]
 then
  prices=`cut -f4 -d: shaun_kasiram_music`
  for i in $prices
  do
   total=$(($total+$i))
  done
  echo "The total price for the collection is \$$total"
 elif [ $number = 5 ]
 then
  echo "Good Bye"
  break
 fi
done