国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > Linux Shell > 正文

linux bash shell中case語句的實例

2020-07-27 19:22:03
字體:
來源:轉載
供稿:網友

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.VeVb-武林網.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

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金山区| 白水县| 壶关县| 日照市| 万载县| 阜新市| 吉木乃县| 砀山县| 六枝特区| 辽宁省| 镶黄旗| 同仁县| 酒泉市| 贡嘎县| 芦山县| 牟定县| 大关县| 陇西县| 南靖县| 农安县| 格尔木市| 务川| 梓潼县| 霍州市| 县级市| 长治县| 蒲城县| 中卫市| 宜兰县| 甘洛县| 临沧市| 和平县| 肃南| 江达县| 浦县| 石泉县| 滦南县| 滁州市| 丰都县| 嘉黎县| 通道|