Hello i'm using Ubuntu 19.10 and bash version is 5.0.3(1)-release. I'm trying to writte script. I checked my bash with which bash command and return was /usr/bin/bash so u put it on first line of script.
#!/usr/bin/bash
declare -i n = 1
while [ $n <= 99 ]
do
echo $n
n = $((n+2))
done
When i try run it i get two errors: test.sh: 2: declare: not found and test.sh: 3: cannot open =: No such file
dash
instead ofbash
, is that right? Are you running it withsh test.sh
? – Arkadiusz Drabczyk Apr 29 '20 at 18:45