SHELL用法五(Case语句)
case $INPUT in Pattern1) 语句1 ;; Pattern2) 语句2 ;; esac
in ) wget -c http://nginx.org/download/nginx-1.16.0.tar.gz ;; esac
select i in redhat centos ubuntu suse(菜单名) do echo $idone
#!/bin/bash PS3="What you like most of the open source system? " select i in redhat centos ubuntu suse do echo "Your Select OS is " $i done
#!/bin/bash PS3="What you like most of the open source system? " select i in redhat centos ubuntu suse do case $i in redhat) echo "redhat linux" ;; centos) echo "centos linux" ;; ubuntu) echo "ubuntu linux";; suse) echo "suse linux" ;; *) exit esac done
find(工具) path(路径) -option(参数) -action(动作); find path -option [ -print ] [ -exec -ok command ]
find / -name eth0find / -name ifcfg-eth0 find / -name "*eth0" find /etc/ -name "*eth0" find /etc/sysconfig/network-scripts/ -name "*eth0"
find / -name auto_mysql_backup.sh find / -name *mysql_backup*.sh
find / -name "*.rpm" find / -name "mariadb*rpm" find / -name "*.rpm" -a -name "mariadb*" find / -name "*.rpm" -name "mariadb*" ! -name "mariadb-libs*" find / -name "*.rpm" -a -name "mariadb*" -a ! -name "mariadb-libs*
for soft in `find / -name "*.rpm" -name "mariadb*" ! -name
"mariadb-libs*"`;do cp $soft /tmp/;done
cp `find / -name "*.rpm" -name "mariadb*" ! -name "mariadb-libs*"`
/tmp/
\cp $(find / -name "*.rpm" -name "mariadb*" ! -name "mariadb-libs*")
/tmp/
find / -name "*.rpm" -name "mariadb*" ! -name "mariadb-libs*" -exec cp
{} /tmp/ \;
find / -name "*.rpm" -name "mariadb*" ! -name "mariadb-libs*"|xargs -I {}cp {} /tmp/
SHELL用法五(Case语句)的更多相关文章
- 03 shell编程之case语句与函数
本文所有内容均来自当年博主当年学习笔记,若有不足欢迎指正 Shell编程之case语句与函数 学习目标: 掌握case语句编程 掌握shell函数的使用 目录结构: Case语句 Case语句的作用 ...
- [shell]流程控制----case语句
Shell case语句为多选择语句.可以用case语句匹配一个值与一个模式,如果匹配成功,执行相匹配的命令.case语句格式如下: case 值 in 模式1) command1 command2 ...
- shell实战之case语句的选择提示
知识点包括:case语句,cat多行输入,break和exit的区别,wget断点续传,while中断条件写法,函数的使用方法 #!/bin/bash echo "\n1. 本机容器情况如下 ...
- Shell基本语法---case语句
case语句 格式 case 变量 in 值1 ) 执行动作1 ;; 值2 ) 执行动作2 ;; 值3 ) 执行动作3 ;; .... * ) 如果变量的值都不是以上的值,则执行此程序 ;; esac ...
- shell脚本之case语句
case ... esac 为多选择语句,与其他语言中的 switch ... case 语句类似,是一种多分枝选择结构,每个 case 分支用右圆括号开始,用两个分号 ;; 表示 break,即执行 ...
- shell中的case语句
case语法: case $arg in arg1) 语句1 ;; arg2) 语句2 ;; *) help 语句 ;; esac eg: eg:
- (二)shell中case语句、程序传参、while
2.2.6.1.case语句(1)shell中的case语句和C语言中的switch case语句作用一样,格式有差异(2)shell中的case语句天生没有break,也不需要break,和C语言中 ...
- shell script 学习笔记-----if,for,while,case语句
1.if内的判断条件为逻辑运算: 2.if内的判断条件为目录是否存在,文件是否存在,下图先检验目录/home/monster是否存在,然后再检测/home/monster中的file.txt文件是否存 ...
- shell的case语句简述(shell的流控制)
shell流控制:http://www.cnblogs.com/yunjiaofeifei/archive/2012/06/12/2546208.html 1.if then else 语句 if t ...
随机推荐
- Linux安装已编译好的FFmpeg,基于centos7
1.访问https://johnvansickle.com/ffmpeg/ 2.下载地址:https://johnvansickle.com/ffmpeg/releases/ffmpeg-releas ...
- Linux(CENTOS7) RabbitMq安装
RabbitMQ是一个在AMQP协议标准基础上完整的,可服用的企业消息系统.它遵循Mozilla Public License开源协议,采用 Erlang 实现的工业级的消息队列(MQ)服务器,Rab ...
- matlab中画一条折线时怎样显示出每个点折点的数值
举个例子: num=[5,44,62,154,264,365,398,480,619,705,762,728,669,726,890,731,707,696,558,509,444];date=[1. ...
- python爬虫--cookie反爬处理
Cookies的处理 作用 保存客户端的相关状态 在爬虫中如果遇到了cookie的反爬如何处理? 手动处理 在抓包工具中捕获cookie,将其封装在headers中 应用场景:cookie没有有效时长 ...
- 解析java实体类
对java实体类的众多理解: A .就是属性类,通常定义在model层里面 B. 一般的实体类对应一个数据表,其中的属性对应数据表中的字段. 好处: 1.对对象实体的封装,体现OO思想. 2.属性可以 ...
- 吴裕雄--天生自然 PHP开发学习:MySQL 预处理语句
<?php $servername = "localhost"; $username = "root"; $password = "admin& ...
- 新手学习Web前端的三个高效学习方法,基础要重视
作为新手,出于对风险的担心,不免在学习一项新技能或者转投一个新行业的时候,有所犹豫与徘徊.毕竟,在这场类似冒险的选择中,我们需要投入时间.精力以及承受相关的经济损失.但是,只有勇敢迈出第一步,才能为生 ...
- Idea创建Spring项目
环境 win7 + Idea2018 Classpath commons-logging-1.2 + spring-framework-4.1.6.RELEASE Step1 创建工程 File -& ...
- python——print函数
.print()函数概述 print() 方法用于打印输出,是python中最常见的一个函数. 该函数的语法如下: print(*objects, sep=' ', end='\n', file=sy ...
- 吴裕雄--天生自然 PYTHON3开发学习:循环语句
n = 100 sum = 0 counter = 1 while counter <= n: sum = sum + counter counter += 1 print("1 到 ...