I'm working on a script to run on terminal like this one
#!/bin/bash
COUNTER=0
while [ $COUNTER -lt 10 ]; do
echo The counter is $COUNTER
yoooooooo
sleep 2
let COUNTER=COUNTER+1
done
exit
But once the counter reaches 9 and the while cycle stops, the terminal wont close with the command "exit".
Here's the output
pi@raspberrypi:~/Desktop $ ./sxdd
The counter is 0
./sxdd: line 7: yoooooooo: command not found
The counter is 1
./sxdd: line 7: yoooooooo: command not found
The counter is 2
./sxdd: line 7: yoooooooo: command not found
The counter is 3
./sxdd: line 7: yoooooooo: command not found
The counter is 4
./sxdd: line 7: yoooooooo: command not found
The counter is 5
./sxdd: line 7: yoooooooo: command not found
The counter is 6
./sxdd: line 7: yoooooooo: command not found
The counter is 7
./sxdd: line 7: yoooooooo: command not found
The counter is 8
./sxdd: line 7: yoooooooo: command not found
The counter is 9
./sxdd: line 7: yoooooooo: command not found
pi@raspberrypi:~/Desktop $
And it never quits... how do I fix that?
exitexits your script, as designed.