Code:
#!/bin/bash
#
##########################
# USA Linux Users Group #
# http://www.usalug.org #
# http://bashscripts.org #
##########################
########################################################
# Board Footage Calculator - For Lumberyards #
########################################################
#
#
#
# FILE: bfcalc
# VERSION: 0.1
# DATE: January 4, 2005
#
# AUTHOR: Dave Crouse <dave NOSPAMat usalug.org>
# PO Box 3210
# Des Moines, IA 50316-0210
# United States
#
# Copyright (C) 2005
# Dave Crouse <dave NOSPAMat usalug.org>
# All rights reserved.
#
########################################################
#########################################################################
# This software is licensed under the GPL - GNU General Public License #
#########################################################################
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc.
# 59 Temple Place, Suite 330
# Boston, MA 02111-1307 USA
#
###################################################################
#######################################################
# This is the sandbox area - testing script functions #
# and other misc NOTES on this project #
#######################################################
#
# TxWxL/12=bf
# (echo scale = 4; echo 23/47) | bc
#
##########################################
## end of sandbox area ##
##########################################
######################
# Start of Variables #
######################
#
#
#
#
######################
# End of Variables #
######################
######################
# Start of Functions #
######################
#
#
board_feet ()
{
echo "This program figures the board feet in a board"
echo "Using the forumla TxWxL/12=bf"
echo "To end this program use CTL-C"
echo " "
while [ "$var1" != "n" ]
do
read -p "Please enter thickness in inches: " thickness
read -p "Please enter width in inches: " width
read -p "Please enter length in feet: " feet
subt=$thickness*$width*$feet
echo " "
echo "This board contains"
(echo scale = 4; echo $subt/12) | bc
echo "board feet."
echo " "
read -p "Would you like to do another calculation (y/n)? " var1
done
}
#
#
####################
# End of Functions #
####################
###########################
# Program run starts here #
###########################
clear
board_feet
exit