[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的更多相关文章

  1. scp报错 -bash: scp: command not found

    环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...

  2. source /etc/profile报错-bash: id:command is not found

    由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...

  3. -bash: .bash_profile: command not found

    今天有一同事安装了ORACLE后,在切换账号时遇到错误提示"-bash: .bash_profile: command not found".如下所示 [root@GLETestL ...

  4. Linux下提示 bash: xxx command not found

    今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...

  5. [原创]-bash: iostat: command not found解决办法

    [root@testhost ~]# iostat-bash: iostat: command not found IOSTAT 命令不可用,首先确认sysstat包是否安装,sysstat包中包括i ...

  6. # mysql -u root -p -bash: mysql: command not found

    [root@jboss ~]# mysql -u root -p-bash: mysql: command not found 需要安装mysql # yum install mysql之后就行 了

  7. bash:fdisk:command not found

    bash:fdisk:command not found [lansir@Red-Hat ~]$ fdisk -l-bash: fdisk: command not found 原因是fdisk不在P ...

  8. Centos提示-bash: make: command not found的解决办法

    一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...

  9. bash: ifconfig: command not found解决方法

    1.问题: #ifconfig bash: ifconfig: command not found 2.原因:非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况 ...

随机推荐

  1. [深度学习]实现一个博弈型的AI,从五子棋开始

    好久没有写过博客了,多久,大概8年???最近重新把写作这事儿捡起来……最近在折腾AI,写个AI相关的给团队的小伙伴们看吧. 搞了这么多年的机器学习,从分类到聚类,从朴素贝叶斯到SVM,从神经网络到深度 ...

  2. CentOS6.5安装Cacti统计图乱码解决

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://fengwan.blog.51cto.com/508652/1430505 这个就 ...

  3. Spring Cloud微服务框架介绍

    Spring Cloud为开发人员提供了一整套的快速构建分布式应用的工具,入服务注册.服务发现.熔断.负载均衡.路由等,提供了开箱即用的各种依赖以及良好的可扩展机制. 目前在Spring Cloud的 ...

  4. jdk1.8新特性应用之Collection

    之前说了jdk1.8几个新特性,现在看下实战怎么玩,直接看代码: public List<MSG_ConMediaInfo> getConMediaInfoList(String live ...

  5. DS03--栈和队列

    一.学习总结 1 关键词: 逻辑结构,存储结构,抽象数据类型,顺序存储类型,链式存储类型,线性表应用 栈和队列 2 使用思维导图将这些关键词组织起来. 二.PTA实验作业 2.1题目1:符号配对 请编 ...

  6. 传输类型为 "multipart/form-data" 的传送写法 (上传文件 和图片)

    一: 传字符的情况: 抓包数据: 传输的数据: python-request写法: 二:上传图片的情况:

  7. eclipse 创建一个java项目 运行

    五.使用Eclipse 1)第一次打开需要设置工作环境,你可以指定工作目录,或者使用默认的C盘工作目录,点击 ok 按钮. 2)创建一个项目 3)输入项目名称,比如我输入Orz_Jlx,然后点击fin ...

  8. 【学步者日记】实现破碎效果 Fracturing & Destruction 插件使用

    全文见原始链接:http://note.youdao.com/noteshare?id=ef5ef90b71da4e960e5bc0da4f3f17ec 下面是预览 示例工程链接:https://pa ...

  9. python调试方法

    之前调试python程序都是用print参数,感觉有点弱爆啊,最近发现python也有类似C语言gdb的工具pdb,记录下pdb的使用方法和心得. 先找了段简单的测试程序: 复制代码 !/usr/bi ...

  10. nginx与tomcat整合

    nginx与tomcat整合   1. 在/usr/local/nginx/conf下面添加文件proxy.conf # cat /usr/local/nginx/confg/proxy.conf p ...