[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] if and [ ] equivalence
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] if and [ ] equivalence |
Date: |
Mon, 12 Mar 2012 14:31:52 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
On 3/12/12 1:45 PM, Ken Irving wrote:
> 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.
It's only syntactic sugar.
> I suppose the standalone command /usr/bin/[ may check for ] as its
> last argument, but otherwise the shell probably parses the whole [
> ... ] construct.
The standalone program and the shell builtin are supposed to behave
identically.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/