[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. 如何使用 nslookup 查域名的 ttl

    如何使用 nslookup 查域名的 ttl nslookup 经常用,但是最近才使用到查 ttl 的信息. 域名的 ttl 也是网站优化的一个重要参数. nslookup -d www.fastad ...

  2. poj 2187 Beauty Contest——旋转卡壳

    题目:http://poj.org/problem?id=2187 学习材料:https://blog.csdn.net/wang_heng199/article/details/74477738 h ...

  3. Spring整合Quartz定时器

    1.添加jar #此处省略spring核心jar包 <dependency> <groupId>org.quartz-scheduler</groupId> < ...

  4. javascript 中的 arguments,callee.caller,apply,call 区别

    记录一下: 1.arguments是一个对象, 是函数的一个特性,只有在函数内才具有这个特性,在函数外部不用使用. 举例: function test(){   alert(typeof argume ...

  5. 监控mysql状态并发送Email

    */10 * * * *  /shell/mysql_status.sh > /dev/null 2>&1 #!/bin/bash port55=`/usr/sbin/lsof - ...

  6. linux命令ls -l的默认排序方式

    差不多快实现完了ls -l,但是在测试阶段发现一个问题,对于包含[a-ZA-Z]之外的字符,系统的排序方式并不一样. 很想了会儿,总算发现原来它的排序方式是无视[a-ZA-Z]之外的字符的 至于怎么发 ...

  7. ConcurrentLinkedQueue 模拟火车售票过程

    火车票类 public class Ticket { private String NO; // 车票编号 private double price; // 票价 public Ticket(Stri ...

  8. postman md5加密例子

    引用方法 {{md5}} 参考:https://www.jianshu.com/p/5a49d1deaf69 实例:

  9. 缺乏libaio包导致报The server quit without updating PID file

    背景: 直接解压安装mysql5.7.18,解压mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz,直接拷贝另外一台数据库的数据目录,启动mysql过程无日志输出,报E ...

  10. MongoDB day01

    MongoDB芒果数据库 数据存储阶段 文件管理阶段(.txt .doc .xlc) 优点:数据可以长期保存:数据有一定格式化规范:可以大量存储:使用简单方便 缺点:数据一致性差:用户查找修改不方便: ...