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 ...
随机推荐
- CSS 选择器权重计算规则(转)
其实,CSS有自己的优先级计算公式,而不仅仅是行间>内部>外部样式:ID>class>元素. 一.样式类型 1.行间 <h1 style="font-size: ...
- 19 docker 多机器通信
1. 本章实验 2. 环境搭建 1.编写 Vagrantfile 并创建虚拟机 并虚拟机node1绑定外部 192.168.205.10:8888 node2绑定外部 192.168.205.10:9 ...
- Ubuntu系统的软件源更换
参考:https://www.daweibro.com/node/142 什么是Ubuntu的软件源? 我们在使用Debian或者Ubuntu的apt-get工具来安装需要的软件时,其实就是从服务器获 ...
- 面向对象 part5
构造函数模式与原型模式结合 function Person(name) = { this.name = name this.friends = ["a", "b" ...
- 使用GitHub管理Repository
对已有的Repository进行修改 将已有的项目克隆到本地 git clone https://github.com/username/project-name 或者同步已经下载的项目 git pu ...
- C/S 和 B/S架构
C/S 和 B/S架构 一.单机架构 应用领域: 植物大战僵尸 office 二.C/S架构 [ 应用领域: QQ 大型网络游戏 计算机发展初期用户去取数据,直接就去主机拿,从这里开始就分出了客户端和 ...
- 5.docker image (镜像)
1.image 是什么 是文件和 meta data 的集合 (root filesystem) 是分层的,并且每一层都可以添加改变删除文件,成为一个新的image 不同的image可以共享相同的la ...
- JS事件高级
1. 注册事件(绑定事件) 1.1注册事件概述 1.2 addEventListener 事件监听方式 1.3 attachEvent 事件监听方式 1.4 注册事件兼容性解决方案 2. 删除事件(解 ...
- Centos7.6环境中安装zabbix3.4
官网链接:https://www.zabbix.com/documentation/3.4/zh/manual/installation/install_from_packages 部署环境 虚拟机服 ...
- vue路由的跳转-路由传参-cookies插件-axios插件-跨域问题-element-ui插件
---恢复内容开始--- 项目初始化 创建一个纯净的vue环境项目,手动书写全局的样式配置,全局的main,js配置 (1)如果vue项目在重构或者出错的时候,手动安装node_modules. 如果 ...