Counter increment in Bash loop not working

前端 未结 13 2425
庸人自扰
庸人自扰 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

提交回复
热议问题