I am trying to run simple script named
while [ $a <= 5 ];
a=$(( a+1 ))
./test.sh: line 4: 0: command not found
./test.sh: line 6: =: No such file or directory
Way better is already mentioned by Anubhava, however this is correct version of your answer.
#!/bin/bash clear a=0 while [[ "$a" -lt 5 ]]; do echo $a a=$(($a+1)) done