shell_02
if判断:
if [$? -eq 0];then
echo "xxxxxxxxxxx"
else
echo "xxxxxxxxxxxxx"
fi
case判断:
case $name in
xxx)
echo "xxxxxxx"
xxx)
echo "xxxxxx"
esac
for循环:
for i in $(seq 1-3)
do
echo "xxxx"
done
while循环:
i=1
while((i<=10))
do
echo $i
let i++
done
while [1] 永久循环
do
echo"ssssss"
sleep 3
done
while [1]
do
read -p "xxxxx":key
test $key = x -o $key = X
if [$? -eq 0]
then
echo "xxxxxxxxxx"
continue 继续下一个循环
echo "xxxxxxxx" 这里不会被输出
else
echo $key
fi
done
shell_02的更多相关文章
- Linux从入门到进阶全集——【第十四集:Shell基础命令】
1,Shell就是命令行执行器 2,作用:将外层引用程序的例如ls ll等命令进行解释成01表示的二进制代码给内核,从而让硬件执行:硬件的执行结果返回给shell,shell解释成我们能看得懂的代码返 ...
随机推荐
- 继承log4.net的类
using System; using System.Diagnostics; [assembly: log4net.Config.XmlConfigurator(Watch = true)] nam ...
- maven远程私服发布jar包
配置项目POM.xml <distributionManagement> <repository> <id>nexus-releases</id> &l ...
- Jquery动态添加 删除 操作实现
这是gridView为空数据时显示的表头 下面直接填代码: function Add() { //动态添加行 $("#gridCustomerView").append(" ...
- 你真的需要一个jQuery插件吗
jQuery的插件提供了一个很好的方法,节省了时间和简化了开发,避免程序员从头开始编写每个组件.但是,插件也将一个不稳定因素引入代码中.一个好的插件节省了无数的开发时间,一个质量不好的插件会导致修复错 ...
- php if语句判定my查询是否为空
<?php header("Content-type: text/html; charset=utf-8"); $username=$_GET['username']; $p ...
- Could not contact Selenium Server; have you started it on 'localhost:4444'
今天学习selenium RC例子的时候遇到一个问题:java.lang.RuntimeException: Could not contact Selenium Server; have you s ...
- Maven仓库的搭建
http://blog.csdn.net/xiao__gui/article/details/52625660 Maven仓库是有特定规则的目录结构. 目录结构由 仓库根目录 , groupId , ...
- 上传Docker镜像到阿里云
1.配置阿里云的镜像加速器:https://cr.console.aliyun.com/#/accelerator 2.命令行登录到阿里云的doker仓库,--username为阿里云的用户名 d ...
- 修改tomcat服务器默认端口号
打开tomcat目录下conf目录下的server.xml,里面会有下面这样一段代码: <Connector port="8080" protocol="HTTP/ ...
- 二 Android Studio 打包EgretApp (开机画面、横竖屏、调试、和原生交互)
测试环境: Windows7 Egret Engine 5.0.14 Egret support 5.0.12 Android Studio 2.3 目录: 一 修改开机画面 二 横竖屏设置 三 修改 ...