Loop variable error while using different syntax for "for loop" Loop variable error while using different syntax for "for loop" unix unix

Loop variable error while using different syntax for "for loop"


You need to run with BASH, so use BASH shebang:

#!/bin/bash

Since this arithmetic BASH loop syntax isn't supported in older bourne shell:

for ((i = 0; i<=5; i++)); do   echo "$i"done