Use shell to write a bank ATM

Source: Internet
Author: User

Or #! /Bin/bash is the source code of the program at the beginning. I feel that learning is a matter of interest. If I feel bored, I will find a way to add some ingredients to learning. I love learning and spoof .. Wow Kaka.


# Renewal #----------------------------------------------------------------------------------------

#! /Bin/bash # 18.sh emu atm main () {# key = 0 echo "% % "echo" Welcome to "echo" 1 query balance "echo" 2 deposit "echo" 3 withdrawal "echo" 4 robbery" echo "% % "} query () {# key = 1 echo "your current balance is:" $ cash echo "Return, press 0"} save () {# key = 2 echo "Enter the deposit amount" read savecash cash = $ ($ cash + $ savecash) echo "Press 2 to continue deposits, to return the result, press 0 "} get () {# key = 3 echo" Enter the withdrawal amount "read getcash if ($ getcash <$ cash )); then cash = $ ($ cash-$ getcash) echo "Continue withdrawal press 3, return press 0" else echo "insufficient balance, to return the result, press 0 "fi} declare-I cash = 10000 main while:; do read I case" $ I "in 0) clear; main; 1) clear; query ;; 2) clear; save; 3) clear; get; 4) clear; exit; *) clear; main; esac done

# Renewal #----------------------------------------------------------------------------------------



650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/060954G42-0.jpg "title =" qq 30912195442.jpg "alt =" 195456488.jpg"/>




This article is from the "history_xcy" blog, please be sure to keep this http://historys.blog.51cto.com/7903899/1295246

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.