[转载] a question about shell script# Unix - 噫吁兮,危乎高哉
P*i
1 楼
【 以下文字转载自 Linux 讨论区 】
【 原文由 pauli 所发表 】
I have a shell script
win.sh
lpc=1
while test $lpc -lt 3
do
awk -f ./tt $1 >./temp.log
TSA temp
lpc="expr $lpc + 1"
mv temp.log $1
done
but when I executed it, I got such an error:
$win chat
win:test: too many argument
Why? How to use cycle correctly in shell? Is it something wrong when I used "test"
【 原文由 pauli 所发表 】
I have a shell script
win.sh
lpc=1
while test $lpc -lt 3
do
awk -f ./tt $1 >./temp.log
TSA temp
lpc="expr $lpc + 1"
mv temp.log $1
done
but when I executed it, I got such an error:
$win chat
win:test: too many argument
Why? How to use cycle correctly in shell? Is it something wrong when I used "test"