Counter increment in Bash loop not working

前端 未结 13 2248
庸人自扰
庸人自扰 2020-12-02 05:31

I have the following simple script where I am running a loop and want to maintain a COUNTER. I am unable to figure out why the counter is not updating. Is it du

相关标签:
13条回答
  • 2020-12-02 06:35
    COUNTER=1
    while [ Your != "done" ]
    do
         echo " $COUNTER "
         COUNTER=$[$COUNTER +1]
    done
    

    TESTED BASH: Centos, SuSE, RH

    0 讨论(0)
提交回复
热议问题