以下代码有什么问题?
while read -r -u 3 line1 && read -r -u 4 line2
do
if [ $line2 = "moon" ] #can i do this?
echo "hi"
fi
done
done 3<file1 4<file2
file1
并且file2
是文本文件,脚本是更大脚本的一部分。我得到的错误是syntax error near unexpected token elif [[ "$line2" = "moon" ]]
.