j
내 질문에는 value 및 i
valuereach 처럼 보입니다 . 6
누구 i
든지 5
설명할 수 있습니까?
i=0;
j=0;
echo "values of $i and $j" > debug.txt;
while [ $j -le 5 ]
do
j=expr $j + 1
i=expr $i + 1
echo "values of $i and $j" >> debug.txt
done;
cat debug.txt;
산출:
value of i is 0 and j is 0
value of i is 1 and j is 1
value of i is 2 and j is 2
value of i is 3 and j is 3
value of i is 4 and j is 4
value of i is 5 and j is 5
value of i is 6 and j is 6
답변1
스크립트가 작동하지 않는 이유는 -le
. -le
으로 변경됩니다 -lt
.