From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13889 invoked from network); 24 Feb 1999 05:15:53 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 24 Feb 1999 05:15:53 -0000 Received: (qmail 28709 invoked by alias); 24 Feb 1999 05:15:03 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2184 Received: (qmail 28696 invoked from network); 24 Feb 1999 05:15:00 -0000 X-Authentication-Warning: c-bart.amazon.com: schaefer set sender to schaefer@tiny.zanshin.com using -f From: Bart Schaefer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14035.35116.392298.579759@c-bart.amazon.com> Date: Tue, 23 Feb 1999 21:07:56 -0800 (PST) To: Danny Dulai Cc: Bart Schaefer , zsh-users@sunsite.auc.dk Subject: Re: Setting paths with ~'s in values. In-Reply-To: <19990223033938.20667@bleep.ishiboo.com> References: <199902122018.PAA29284@po_box.cig.mot.com> <990212140558.ZM11520@candle.brasslantern.com> <19990222172007.61479@bleep.ishiboo.com> <14034.13710.335334.486111@c-bart.amazon.com> <19990223033938.20667@bleep.ishiboo.com> X-Mailer: VM 6.65a under Emacs 20.3.5.1 Reply-To: Bart Schaefer Danny Dulai writes: > what is the difference between [[ ... ]] and [ ... ] ? `[[ ... ]]` is a lexical construct; in effect, `[[` and `]]` are reserved words (though I don't recall if they're actually implemented that way). `[` is just a command that happens to look for an argument ']', and interprets everything in between. That means that the `...` in a `[[ ... ]]` expression can be treated specially by the parser, so you can use things like `&&` and `||` where `[` and `test` require -a and -o. In particular, the equality test in a `[[`-expression uses pattern matching, so glob characters in such expressions are not expanded against the filesystem. That's what I've repeatedly been forgetting the last few weeks. > Is [[ the builtin version of the test command? No, `[` is the builtin version of `test`; but many of the conditional expressions supported by `test` are also supported by `[[ ... ]]`, which is the source of much of this confusion.