[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. dict 没有 key 的情况

    如何处理, 请参考下文,  主要是要理解思路, https://www.polarxiong.com/archives/Python-%E6%93%8D%E4%BD%9Cdict%E6%97%B6%E ...

  2. minio 安装以及使用

    1. 为了方便使用 docker 安装 docker run -p 9000:9000 minio/minio server /export   注意启动显示的 appkey secretkey  C ...

  3. Gixy Nginx 配置分析工具

    项目简介 Gixy 是一款用来分析 Nginx 配置的工具. Gixy 的主要目标是防止安全配置错误,并自动进行缺陷检测. 目前支持的 Python 版本是 2.7 和 3.5+ . 免责声明:Gix ...

  4. 使用Costura.Fody将源DLL合并到目标EXE

    本文为原创文章,如转载,请在网页明显位置标明原文名称.作者及网址,谢谢! 一.本文主要是使用Costura.Fody工具将源DLL合并到目标EXE,因此,需要从以下任一链接下载: ①从Github地址 ...

  5. 关于ng-class,ng-style的用法

    ng-class的使用几种方式 (1):利用双向数据绑定(className根据chang2的值去匹配类) <div class="{{className}}">... ...

  6. ubuntu下eclipse安装maven插件

    ubuntu科输入如下指令安装eclipse:sudo apt-get install eclipse ubuntu下安装maven插件打开Eclipse点击Help -> Install Ne ...

  7. mac系统PHP 7.1.12安装xhprof并使用[View Full Callgraph]小记

    前几天从php7.0.x 升级到了php7.2.0版本, 结果装xhprof没有找到能支持对应版本的xhprof 于是又安装了一个php7.1.2的版本(brew install h) 接着安装xhp ...

  8. 老齐python-基础7(文件操作、迭代)

    在python3中,没有file这个内建类型了(python2中,file是默认类型) 1.读文件 创建文件,130.txt 并在里面输入 learn python http://qiwsir.git ...

  9. Nginx RTMP 模块 nginx-rtmp-module 指令详解

    译序:截至 Jul 8th,2013 官方公布的最新 Nginx RTMP 模块 nginx-rtmp-module 指令详解.指令Corertmp语法:rtmp { ... }上下文:根描述:保存所 ...

  10. ffmpeg 基本数据结构和对象: AVPacket、AVPicture、AVFrame

    一.AVPacket /** * AVPacket 作为解码器的输入 或 编码器的输出. * 当作为解码器的输入时,它由demuxer生成,然后传递给解码器 * 当作为编码器的输出时,由编码器生成,然 ...