I'm new to bash and I'm trying to make a stock market (simulated) script. Now I'm trying to read an input (1 digit long) for 5 seconds, if there's none then keep on going but if there's input then call a function.
The piece of code I cannot get to work is this
while true
do
menu
printValues
frames=$(($frames+1))
read -t 5 -n 1 option
if [ $option -ge 0 && $option -le 9 ]
then
buyMenu
fi
clear
done
If clarify is needed please reply! I appreciate the help!