bash's [ command & [[ keyword
[bash's [ command & [[ keyword]
[ (test) command:
bash中的条件测试語句, [ condition ], 并不是一个語句, 而是一个命令, 命令的名字是 [ , 这个命令期待最后一个参数是 ] .
在terminal中键入 whereis [, 可以看到[ 命令被放在系统中的哪个地方.
[[ keyword:
[[是[的扩展, 是bash中的keyword,提供比[更强大的功能, 更方便的使用方法.
Special primitives that [[ is defined to have, but [ may be lacking (depending on the implementation):
As a rule of thumb, [[ is used for strings and files. If you want to compare numbers, use an ArithmeticExpression
参考:
1. http://bash.cumulonim.biz/FullBashGuide.html
2. http://bash.cumulonim.biz/BashFAQ(2f)031.html
bash's [ command & [[ keyword的更多相关文章
- scp报错 -bash: scp: command not found
环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...
- source /etc/profile报错-bash: id:command is not found
由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...
- -bash: .bash_profile: command not found
今天有一同事安装了ORACLE后,在切换账号时遇到错误提示"-bash: .bash_profile: command not found".如下所示 [root@GLETestL ...
- Linux下提示 bash: xxx command not found
今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...
- [原创]-bash: iostat: command not found解决办法
[root@testhost ~]# iostat-bash: iostat: command not found IOSTAT 命令不可用,首先确认sysstat包是否安装,sysstat包中包括i ...
- # mysql -u root -p -bash: mysql: command not found
[root@jboss ~]# mysql -u root -p-bash: mysql: command not found 需要安装mysql # yum install mysql之后就行 了
- bash:fdisk:command not found
bash:fdisk:command not found [lansir@Red-Hat ~]$ fdisk -l-bash: fdisk: command not found 原因是fdisk不在P ...
- Centos提示-bash: make: command not found的解决办法
一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...
- bash: ifconfig: command not found解决方法
1.问题: #ifconfig bash: ifconfig: command not found 2.原因:非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况 ...
随机推荐
- ballerina 学习一 基本项目安装试用
ballerina介绍 建议参考这篇文章: https://mp.weixin.qq.com/s/DqdlOhquqMaGOJf26lANPw 1. 安装 直接下载对应操作系统的二进制文件即 ...
- C# 线程间不能调用剪切板的问题
最近做一个项目,需要用到线程,而且要用到剪切板,创建了一个子线程之后发现在子线程中剪切板上获取不到数据,当时特别纳闷,上网查资料,最后终于搞定,现将解决方法归纳如下: 第一步: public void ...
- getpwuid()
getpwuid函数是通过用户的uid查找用户的passwd数据.如果出错时,它们都返回一个空指针并设置errno的值,用户可以根据perror函数查看出错的信息. 外文名 getpwuid() 头文 ...
- Java 实现 RSA 非对称加密
非对称加密算法:用两个密钥(公钥/私钥)对数据进行加密和解密. 一.原理 非对称加密算法实现机密信息交换的基本过程是: 1)甲方生成一对密钥并将其中的一把作为公用密钥向其它方公开; 2)得到该公用密钥 ...
- 软RAID 0的技术概要及实现
1 什么是RAID,RAID的级别和特点 : 什么是RAID呢?全称是 “A Case for Redundant Arrays of Inexpensive Disks (RAID)”,在1987年 ...
- C语言的补码表示和unsigned及signed的转换
这东西实际编程时一直无视的,范围小了就换个大点的表示形式,但是总觉得基础知识还是掌握得好,免得到时候用移位运算或类型转换或笔试题时要花时间想. C语言的基本类型有char.int.float.doub ...
- demo 2 chart 报表
function killerrors() { return true; } window.onerror = killerrors; //检查浏览器类型 function checkBrowser( ...
- 561. 数组拆分 I
题目 python class Solution: def arrayPairSum(self, nums): """ :type nums: List[int] :rt ...
- 高德js API根据出行方式和出现策略由起始点经纬度实现路线规划
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http ...
- MUI 支付宝支付接入
沙箱测试地址:https://openhome.alipay.com/platform/appDaily.htm 1资源下载地址:https://docs.open.alipay.com/54/106 ...