linux bash shell中case语句的实例
2013-11-07 00:00
726 查看
bash case语句的例子。
分享一段bash shell代码,对于学习bash的同学理解case语句的用法,会有帮助。
例子:
分享一段bash shell代码,对于学习bash的同学理解case语句的用法,会有帮助。
例子:
#!/bin/bash ## # Program: # File operation # 1.) Open file 2.) Display file 3.) Edit file 4.) Delete file # site: WWW.JB51.NET PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH echo "---------------------------------" echo "List of item to operate file -" echo "---------------------------------" echo "1). Open a file -" echo "2). Display a file -" echo "3). Edit a file -" echo "4). Delete a file -" echo "---------------------------------" read select case $select in 1) echo "do open file operation" 2) echo "do display a file operation" 3) echo "do edit a file operation" 4) echo "do delete a file operation" *) echo "There is nothing to do!" exit 1 esac
相关文章推荐
- linux bash shell中case语句的实例
- linux bash shell中case语句的实例
- linux bash shell中case语句的实例
- linux下Bash编程case语句及编写脚本(八)
- Linux下shell中的case循环语句
- linux bash shell.sh编程实例
- Shell 脚本之循环语句(for,while,until)以及case,select,break,continue实例详解
- 10个 Linux/Unix下 Bash 和 KSH shell 的作业控制实例
- 27_Shell语言――――case语句、bash如何与用户进行交互(case、read)
- linux-shell中case与select语句
- Linux Bash Shell学习(十一):流程控制——case
- Linux基础之bash脚本编程进阶篇-选择执行语句(if,case)
- Linux-shell脚本-if语句/case语句
- leeboy的linux学习十五 shell中条件测试和简单的条件语句实例
- shell中的case语句实例介绍
- [9-13]Shell系列3――分支结构if与case语句
- Linux操作系统基础解析之(七)——Bash(Shell)基础知识(2)
- linux shell 流程控制(条件if,循环【for,while】,选择【case】语句实例
- ORACLE PL/SQL 实例精解之第五章 条件控制:CASE语句
- [Linux] Vim+bash-support的Bash Shell IDE快捷键;