select用法
来源:互联网 发布:iphone神器软件 编辑:程序博客网 时间:2024/05/01 11:36
select 语句
select表达式是bash的一种扩展应用,擅长于交互式场合。用户可以从一组不同的值中进行选择:
select var in ... ; do break;done.... now $var can be used ....
下面是select使用的例子:
1.
#!/bin/bash##filename:what-lang-do-you-like_menu_select.sh clearPS3="What is your preferred scripting language? "select s in bash perl python ruby'(quit)'do case $s in bash|perl|python|ruby) echo "You selected $s ." ;; '(quit)') break ;; *) echo "You selected error,retry..." ;; esacdone
2.#!/bin/bash##filename:what-lang-do-you-like_menu_select.sh clearPS3="What is your preferred scripting language? "select s in bash perl python ruby'(quit)'do case $s in bash|perl|python|ruby) echo "You selected $s ." ;; '(quit)') break ;; *) echo "You selected error,retry..." ;; esacdone
阅读全文
0 0
- select用法
- select()用法
- select()用法
- select()用法
- select用法
- select 用法
- select用法
- select用法
- select 用法
- select用法
- select 用法
- select用法
- select用法
- select用法
- select用法
- select 一些用法
- select 中的DISTINCT用法
- socket select()用法
- 数据结构练习题
- C构造线性表
- hud 1013 求一个数的数字根
- Ubuntu16.04.3LTS+CUDA8.0+cudnn5.1+tensorflow-gpu(1.2)安装配置信息汇总
- android 判断手机是否有物理menu键
- select用法
- 【bzoj3170】[Tjoi 2013]松鼠聚会
- 停课总结(三)
- codeforces——875B —— Sorting the Coins
- 分治算法-球队循环赛日程安排-java实现
- AndroidStudio调试smali代码
- mergeTwoSortList
- 堆栈模拟队列
- printListReverse