You are not logged in.
function addproduct {
x="n"
while $x == [n]
do
clear
echo Add new product
echo ""
echo "Product number:"
read PRID
echo "Product description:"
read PRDE
echo "Product type:"
read PRTY
echo "Product manufacturer:"
read PRMF
echo "Product price:"
read PRPR
#PREY=`date +%y`
#PREY=$(( $PREY * 12 ))
#PREM=`date +%m`
#PRED=$(( $PREY + $PREM ))
clear
PRODUCT="$PRID | $PRDE | $PRTY | $PRMF | $PRED | £$PRPR"
echo $PRODUCT
echo "are details correct?"
read x
done
echo $PRODUCT >> prices.dat
}
The loop continues forever, I need it to stop on a y.
also why I am here
Can I get the read to follow onto the end of my echo line instead of underneath it?
You can probably work out what I am trying to do with the date part that is temp #'d out. Any idea why that does not work?
Many Thanks
Last edited by gazj (2009-01-19 22:44:54)
Offline
I think this is something like what you're after...
x="n"
while [ $x == "n" ] ; do
clear
echo Add new product
echo ""
read -p "Product number:" PRID
read -p "Product description:" PRDE
read -p "Product type:" PRTY
read -p "Product manufacturer:" PRMF
read -p "Product price:" PRPR
clear
PRODUCT="$PRID | $PRDE | $PRTY | $PRMF | $PRED | £$PRPR"
echo $PRODUCT
echo "are details correct?"
read x
done
echo $PRODUCT >> prices.dat
Last edited by fukawi2 (2009-01-19 22:53:27)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Offline