我有运行为下面的脚本:化妆用户输入循环变量
>> bash test.sh < 0 0
内test.sh
read $sni
read $snf
echo 'Run between '$sni' and '$snf
for i in {sni..snf}
do
done
,但我得到了以下错误:
test.sh: line 14: [: {sni..snf}: integer expression expected
test.sh: line 19: [: {sni..snf}: integer expression expected
如何制作循环变量整数?谢谢。
另外,你应该使用'read sni',因为你*不需要在那里插入可变插值。 – jpaugh 2013-05-10 22:35:22
@jpaugh广告1)可悲的是,你不能。如果你想在这里使用变量,你必须使用'seq'(无论如何都使用'bash')。 – 2013-05-10 22:39:36
哎唷!哇!你是对的。 – jpaugh 2013-05-10 22:42:04