Is double square brackets [[ ]] preferable over single square brackets [ ] in Bash?

前端 未结 9 2050
情话喂你
情话喂你 2020-11-22 03:58

A co-worker claimed recently in a code review that the [[ ]] construct is to be preferred over [ ] in constructs like

if [ \"`id -         


        
9条回答
  •  盖世英雄少女心
    2020-11-22 04:48

    [[ ]] double brackets are unsuported under certain version of SunOS and totally unsuported inside function declarations by : GNU bash, version 2.02.0(1)-release (sparc-sun-solaris2.6)

提交回复
热议问题