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
。