标签:一个 实现 运行 and cas one pre UI bash
select也是循环的一种,它比较适合用在用户选择的情况下。1. #!/bin/bash
2. echo "Please chose a number, 1: run w, 2: run top, 3: run free, 4: quit"
3. echo
4. select command in w top free quit
5. do
6. case $command in
7. w)
8. w
9. ;;
10. top)
11. top
12. ;;
13. free)
14. free
15. ;;
16. quit)
17. exit
18. ;;
19. *)
20. echo "Please input a number:(1-4)."
21. ;;
22. esac
23. done
标签:一个 实现 运行 and cas one pre UI bash
原文地址:http://blog.51cto.com/amazing61/2063860