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 ,其它的命令也可以出现这种情况 ...
随机推荐
- java 二维码生成(vcard)
1. maven 依赖 <dependency> <groupId>com.googlecode.ez-vcard</groupId> <artifactId ...
- 【深度学习笔记】Anaconda及开发环境搭建
在学习了一段时间台大李宏毅关于deep learning的课程,以及一些其他机器学习的书之后,终于打算开始动手进行一些实践了. 感觉保完研之后散养状态下,学习效率太低了,于是便想白天学习,晚上对白天学 ...
- 搭建一个IntelliJ的Spark项目
之前发现创建一个新项目之后,无法添加scala class 创建新项目 选择maven项目,然后选择simple或者quickstart: 进入项目后,在Project Structure里面,在gl ...
- linq左连接
Table1和Table2连接,把Table1的全列出来 var tempData = from a in table1 join b in table2 on a.Id equals b.aId i ...
- SharePoint无法搜索解决
重启服务器后,站点搜索时提示错误,无法进行搜索,进入管理中心搜索管理看到,"查询处理"出错. 解决方法: 停止搜索服务,重新启动,如下图所示 重启服务后,过了几分钟重新查询,查询正 ...
- Docker的一些常用
日常使用的一些命令 1234567891011121314 docker pull mysql:tags // 拉mysql的tag版本 docker run -it -p(端口映射-主机端口:容器端 ...
- CMD中文显示为乱码
中文显示为乱码 临时解决方案: 在 CMD 中运行 chcp 936. 永久解决方案: 打开不正常的 CMD 或命令提示符窗口后,单击窗口左上角的图标,选择弹出的菜单中的“默认值”,打开如下图的对话框 ...
- jquery json string 转换 合并
Jquery 1.9.1 var BODY = { "recipients": { "values": [] }, "subject": ' ...
- Zookeeper--安装及命令
Zookeeper--单机模式安装 及命令 下载地址: http://zookeeper.apache.org/releases.html tar -zxvf zookeeper-3.4.10.tar ...
- SpringMVC中注解控制器及数据绑定
一.Spring2.5之前,我们都是通过实现Controller接口或其他实现来定义我们的处理器类. 二.Spring2.5引入注解式处理器支持,通过@Controller 和 @RequestMap ...