[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] if and [ ] equivalence
From: |
Ken Irving |
Subject: |
Re: [Help-bash] if and [ ] equivalence |
Date: |
Mon, 12 Mar 2012 09:45:57 -0800 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Mon, Mar 12, 2012 at 12:22:36AM -0400, DJ Mills wrote:
> ... '[' is just a command, like any other. Same with '&&'
Most commands ('&&' included) don't require terminating constructs
further along the command line, so '[' seems unusual to me.
I suppose the standalone command /usr/bin/[ may check for ] as its
last argument, but otherwise the shell probably parses the whole [
... ] construct.
I prefer using 'test' over '[' in scripts, but is the latter more
efficient?
Ken