having a little trouble with this rather basic script. This script works on Bash in my macbook pro, but not on my Linux Mint desktop, which also uses bash.
I can't figure out what's wrong with it.
I'm still getting an error from bash saying:
line 6: [: -lt: unary operator expected
line 16: [: -gt: unary operator expected
with this updated code:
#!/bin/bash
clear
counter=0
function countup {
while [ $counter -lt 500 ]
do
((counter++))
echo $counter
sleep 0.2
done
countdown
}
function countdown {
while [ $counter -gt 0 ]
do
((counter--))
echo $counter
sleep 0.2
done
countup
}
countup
0=>0 ]and remove:in both functions"$counter").