如果在bash中声明错误

mon*_*ool 3 linux bash

i=0
for f in `awk '{print $1}' config.list`
do
    echo "i value is $i"
    if ["$i" = "0"]
    then
        echo "here"
        i=$((i+1))
        continue 
    fi
    arr[i]=$f  
    i=$((i+1))
done
Run Code Online (Sandbox Code Playgroud)

在上面的bash脚本中,我收到一个错误,我使用了if语句,看起来像这样

./script.sh: line 5: [0: command not found
Run Code Online (Sandbox Code Playgroud)

请指出我可能是我的错误.

Har*_*non 8

使用 if [ "$i" = "0" ]

在bash,你需要周围的空间[,并]if条件