All pastes #954779 Raw Edit

Something

public text v1 · immutable
#954779 ·published 2008-03-24 02:50 UTC
rendered paste body
read -p " Welcome to Melanie's checkbook script. Please set the active year " y
read -p "The active year is currently $y . If you would like to add a record to the active year, enter a. If you would like to display the records from the active year, enter d. If you would like to set a new active year, enter y. If you would like to save a record, enter s. If you wish to exit, enter e." adyse
case $adsye in
a) read -p "Please enter the amount." a
echo "Amount: $a" >> $y.txt
read -p "Please enter the ID." i
echo "ID: $i" >> $y.txt
read -p "Please enter the date." d
echo "Date: $d" >> $y.txt
read -p "Please enter some details." t
echo "Details: $t" >> $y.txt
echo "Record: 0" >> $y.txt
read -p "Please enter the type." p
echo "Type: $p" >> $y.txt | more ;;
d) echo "Here are the records from $y ." 
cat $y.txt || echo "No records from $y are available." | more ;;
y) read -p "Specify the new active year." y | more ;;
s) read -p "Save file as? " f
touch $f.txt || touch acct.sh | more ;;
e) echo "Goodbye!"
exit ;;
*) read -p "The active year is currently $y . If you would like to add a record to the active year, enter a. If you would like to display the records from the active year, enter d. If you would like to set a new active year, enter y. If you would like to save a record, enter s. If you wish to exit, enter e." ;;
esac


$ . checkbook.sh
 Welcome to Melanie's checkbook script. Please set the active year 08
The active year is currently 08 . If you would like to add a record to the active year, enter a. If you would like to display the records from the active year, enter d. If you would like to set a new active year, enter y. If you would like to save a record, enter s. If you wish to exit, enter e.d
The active year is currently 08 . If you would like to add a record to the active year, enter a. If you would like to display the records from the active year, enter d. If you would like to set a new active year, enter y. If you would like to save a record, enter s. If you wish to exit, enter e.a
:: marshallm@Net212s [~]:::
$