Skip to main content

Timeline for If statement [ or [[ or ( or ((?

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Aug 11, 2020 at 20:01 comment added JoBe I c, but if I'm writing one for only me, to be run on only one computer, with bash, wouldn't using [[ ]] everywhere eliminate any mistakes I might do when writing [ ] and trying to test something that's not supported in the [ ] test?
Aug 11, 2020 at 19:49 comment added jesse_b @JoBe: not necessarily. Often in shell scripting portability is strongly desired so if [ works for you there is nothing wrong with using it.
Aug 11, 2020 at 19:47 vote accept JoBe
Aug 11, 2020 at 19:47 comment added JoBe so with other words, if I'm working is bash, it's better to use [[ ]] instead of [ ], since this is the "old" way, and [[ ]] is more and better?
Aug 11, 2020 at 19:16 history answered jesse_b CC BY-SA 4.0