输入:1 - > 2- 如何获得的最后一个元素在管线
while read -a line; do
if ((line[2] < 1)); then
echo "Graph does not match known sites3"
exit
fi
done < "$2"
错误
syntax error: invalid arithmetic operator (error token is "")
出于某种原因,线[2]不被视为数字2。 .. 我该如何解决这个问题?
无法重现你的问题。你能否将确切的输入更清晰? – Mat
打开shell调试以查看您的条件处理,即'set -vx'。祝你好运。 – shellter
谢谢大家... – Christine