I know C64 basic really well (am I getting old?), but am a newb in bash.
Function seems like a gosub in basic. I need something more like a goto.
Anyway here is part of my script, you will see how I am calling a function from within a function (even the current function) how can I avoid this with something that will work.
Here it is.
Code:
function searchproduct {
clear
echo Search product
echo ""
read -p "Enter product id / description / type / manufacturer: " PRS
clear
echo "ID |Description |Category |Manufacturer |Price"
grep $PRS $DATFILE
echo ""
read -p "1 - Main menu | 2 - New search | 3 - Print results" x
menu () case $x in
1)
menu
;;
2)
searchproduct
;;
3)
printproduct
;;
esac
}
Many Thanks