Get the App
SLTechnology News&Howtos  ›  Servers  › 

Shell script example-- Shopping case of Shopping Mall

Shulou Source: shulou.com Published: 2022-06-02 21:21:09 11月15日 Update

Shell script basic cycle, judgment sentence exercise example Shopping cart case #! / bin/bashxie=200ku=150yi=100huan=50chi=120num=0for ((iTunesi / dev/null;;2) let num+=$ku echo total price is "$num" & > / dev/null;;3) let num+=$yi echo total price is "$num" & > / dev/null;;4) let num+=$huan echo total price is "$num" & > / dev/null;;5) let num+=$chi echo total price is "$num" & > / dev/null *) echo "your choice is wrong, please check and enter" esacdonedoneecho the total price of your purchase is: $num

Tags: Total price mall instance case script shopping foundation statement shopping cart loop check input select Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Tech Info Xiaomi Linux MySQL