shell 中的if语句
if [ t != "." -a t != ".." ]
之前一直不知道 -a 是什么意思,后来才知道 -a = and ; -o = or
shell 中的if语句的更多相关文章
- Shell中的循环语句实例
1.for循环语句实例1.1 最基本的for循环 #!/bin/bash for x in one two three four do echo number $x done 注:" ...
- shell中的比较语句
Linux比较字符串.判断文件是否存在及是否可读等,通常用"[]"来表示条件测试. 注意:这里的空格很重要.要确保方括号的空格.笔者就曾因为空格缺少或位置不对,而浪费好多宝贵的时间 ...
- shell中的循环语句
for语法格式 for var in list;do commands done 其中list可以包含: 1) 直接写 for alpha in a b c d;do echo $alpha done ...
- Shell中常用的语句
exit 完全中断脚本的执行 break 中断脚本的循环,但是会执行循环外的语句 continue 跳出本次循环,进行下一次循环 进一步了解三者的区别,有如下实验: 执行该脚本: 脚本正常运行情况: ...
- shell中的case语句
case语法: case $arg in arg1) 语句1 ;; arg2) 语句2 ;; *) help 语句 ;; esac eg: eg:
- shell中的if语句
语法格式 if command;then commands fi 其中的command包含如下: shell command 任何shell命令,如果shell命令返回0,代表true,否则,代表fa ...
- shell中的循环语句while
循环语句的结构: ------------| while 条件 | do | 需要执行的命令 | done | -----------| 例如: 1.while一直循环 2.whi ...
- shell 中 if then语句中会跟着-ne -ge之类的参数的含义
if [ 1 -ne 1 ];then...fi这是指当1不等于1时执行then后的语句 -eq:等于-ne:不等于-le:小于等于-ge:大于等于-lt:小于-gt:大于
- shell中的判断语句
1.字符串判断 str1 = str2 当两个串有相同内容.长度时为真 str1 != str2 当串str1和str2不等时为真 -n str1 当串的长度大于0时为真(串非空,变量) -z str ...
随机推荐
- 为 Android 平台开发一个输入法
学习目标: 实现新的输入法 学习目的: 掌握Android输入法框架 学习收获: Android 1.5 新特色之一就是输入法框架(Input Method Framework,IMF),正是它的出现 ...
- yii的增删改查
要想实现数据库的操作,必须首先初始化数据模型. 一.yii的数据库模型的初始化有两种.第一种是利用模型的静态方法model:第二种是实例化一个新的模型.以例子说明: //数据的查询关键代码 $good ...
- Java中的final和static
final final可以用在类.方法.变量上. 1.final用在类上,表明当前类它不能被继承,没有子类. 2.final用在方法上,表明当前方法不能被override,不能被重写. 3.final ...
- Learning Android ActionBar
PART1:Make Android2.1 Support ActionBar Last evening I learnt how to make android2.1 support actionb ...
- <编译>条件编译——判断当前使用的编译器及操作系统
有时候编译需要多平台运行的代码,需要一些条件编译,经常忘记,这里专门记录一下,方便下次查找. 编译器 GCC #ifdef __GNUC__ #if __GNUC__ >= 3 // GCC ...
- SPOJ:Another Longest Increasing Subsequence Problem(CDQ分治求三维偏序)
Given a sequence of N pairs of integers, find the length of the longest increasing subsequence of it ...
- 初始化cache_dir(squid)
sed -i '/adjustFactor/d' /CNCLog/exactTraffic/conf/localTraffic.cfgecho "adjustFactor = '-0.67 ...
- [Codeforces 715C] Digit Tree
[题目链接] https://codeforces.com/contest/715/problem/C [算法] 考虑点分治 一条路径(x , y)合法当且仅当 : d(x) * 10 ^ dep(x ...
- ab-如何提交post请求
ab -n 1 -c 1 -p post.txt http://***********/ 文件post.txt中存放要post的数据
- VirtualBox下安装ubuntu图文教程以及软件安装
一. 下载安装VirtualBox 官网下载VirtualBox,目前版本:VirtualBox 5.1.8 for Windows hosts x86/amd64 下载好了安装VirtualBox, ...