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 ...
随机推荐
- win10设置开机以及开机无密码验证
1.开机自启动 将程序的exe的快捷方式放入下列文件夹中 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp 2.开机无登录验证 ...
- 18 11 11 网络通信大都数使用的方式 socket
---恢复内容开始--- 浏览器 和 聊天工具 一般都用socket socket 在不同的 语言中的使用流程都大同小异 收 发 关闭 import socket def len() ...
- min25筛学习笔记
min25筛简介:用来求积性函数F(x)前缀和的,复杂度O(n0.75/logn),大概能求n<=1010. 记一个数x的最小质因子为R(x),所以当x不为质数时,R(x)<=√x这是废话 ...
- Tomcat server.xml常用配置 含有外带文件及默认host
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE server-xml [<!ENTITY ...
- fatal error C1189: #error: "You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler."
使用VS开发tensorflow的C++程序的时候,就可能会遇上这个问题,解决方法是在引入tensoflow的头文件之前添加: #define COMPILER_MSVC #define NOMINM ...
- 86.QuerySet API常用的方法详解:get方法
get方法的查询条件只能有一条数据满足,如果匹配到多条数据都满足,就会报错:如果没有匹配到满足条件的数据,也会报错. 示例代码如下: from django.http import HttpRespo ...
- image compression with libjpeg
http://www.aaronmr.com/en/2010/03/test/ Working on the project I've seen in the need for compression ...
- springboot cloud 网盘
boot https://pan.baidu.com/s/12SkGJNu_M-I-pjg-GxqHRw 5uga boot-cloud https://pan.baidu.com/s/1gO ...
- 洛谷 P5017 摆渡车
题目传送门 解题思路: 个人感觉DP这东西,只可意会,不可言传 AC代码: #include<iostream> #include<cstdio> #include<cs ...
- ant design vue 时间选择器只能到最大日期
<a-date-picker :disabledDate="disabledEndDate" style="width: 100%" placehold ...