I want to print two iterators named
j of nested
for loops whenever they are not equal. The error message:
syntax error near unexpected token `then'
#!/bin/bash read n array=() for i in `seq 1 $n` do read num array+=$num done count=0 count2=0 countmax=0 for i in `seq 1 $n`; do for j in `seq 1 $n`; do if [ $i -ne $j ]; then echo $i $j fi done done
What have I done wrong?