shell 练习(function,case,for,select)
来源:互联网 发布:手机微博淘客软件 编辑:程序博客网 时间:2024/06/06 00:23
#!/bin/bashsquare(){ echo "Please input the num:" read num1 let "squ=num1*num1" echo "Square of $num1 is $squ"}cube(){ echo "Please input the num:" read num2 let "c=num2*num2*num2" echo "Cube of $num2 is $c"}power(){ echo "Please input the num:" read num3 echo "Please input the power:" read p let "temp=1" for(( i=1;i<=$p;i++ )) do let "temp=temp*num3" done echo "power $p of $num3 is $temp."}choice(){ select i in "square" "Cube" "Power" do break; done echo "you select is $i" case $i in square) square ;; Cube) cube ;; Power) power ;; *) echo "select item is not exist" esac}choice
0 0
- shell 练习(function,case,for,select)
- shell if case while select for
- shell编程中for/while/util/case/select/break/continue
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- Shell 脚本之循环语句(for,while,until)以及case,select,break,continue实例详解
- shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select
- shell编程中for,while,util,case,select,break, continue用法详解
- Shell case esac 和 for
- shell编程基础(4)case 与 function
- shell 练习(for,while,until,local)
- if for while util case select 参数
- SHELL笔记:-if-else,case练习
- Shell脚本基础13-case练习举例
- linux shell编程控制结构:expr、let、for、while、until、shift、if、case、break、continue、函数、select 学习笔记
- Java集合框架总结(2)——Set接口的使用
- redis系统介绍
- Android优化技术详解-第七章 代码优化(笔记)
- c++基本数据结构的类的用法--栈,队列,链表
- OpenFlashChart2的使用
- shell 练习(function,case,for,select)
- JqueryUI AutoComplate实现文本框搜索,自动补全效果
- Java集合框架总结(3)——TreeSet类的排序问题
- GoF设计模式之适配器模式
- python操作数据库PostgreSQL
- android获得布局的Bitmap对象
- python中函数参数传递的几种方法
- 分支限界和回溯法的对比
- 段描述符