Shell script example-- Shopping case of Shopping Mall
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