I am trying to do a while loop while waiting for user input.
read x
while [ $x == 3 ]
do
echo yay
done
does not do what I want. Of course it does not work, but I type that and make sure no one gets confused
I am trying to do a while loop while waiting for user input.
read x
while [ $x == 3 ]
do
echo yay
done
does not do what I want. Of course it does not work, but I type that and make sure no one gets confused
Well, I figured it out.
loop(){ while true; do echo -n .; sleep 2; done; }
loop & read x
kill %1
This defines a function called loop, runs it in background, waits for user input, then stops the background process.