From: Pandu Poluan <pandu@poluan.info>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] "/usr/bin/[" and coreutils
Date: Tue, 8 Nov 2011 13:01:48 +0700 [thread overview]
Message-ID: <CAA2qdGX+ej080ZsvguuCjB_qhLWZZT2y2g4EWJoVZ62Wm3d7Mw@mail.gmail.com> (raw)
In-Reply-To: <CAGo3WeoRk8fe7E88M43UJ_2rdZyXbGSY5Y9=hOU36Lm78kA4UA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
On Nov 8, 2011 9:02 AM, "Claudio Roberto França Pereira" <spideybr@gmail.com>
wrote:
>
> What about [[? I've seen scripts using [[ instead of only one [. Whats
the point/difference?
AFAIK [[ was originally a bash-specific built-in command that provides more
functionality than /bin/[, but can still use /bin/['s convoluted syntax.
The two converged quickly, though. IIRC [ is now also a bash built-in,
which still maintains compatibility with /bin/[
An example:
[ $VAR ] will produce an error if VAR is empty or unset, but [[ $VAR ]]
won't.
(for the former, you have to put double quotes around, e.g., [ "$VAR"] )
Rgds,
[-- Attachment #2: Type: text/html, Size: 783 bytes --]
next prev parent reply other threads:[~2011-11-08 6:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-12 5:35 [gentoo-user] "/usr/bin/[" and coreutils William Kenworthy
2011-10-12 5:42 ` Canek Peláez Valdés
2011-10-12 16:49 ` Jonas de Buhr
2011-10-13 13:38 ` Jesús J. Guerrero Botella
2011-10-13 13:50 ` Alan McKinnon
2011-10-13 13:59 ` Michael Mol
2011-10-13 14:30 ` Alan McKinnon
2011-11-08 1:53 ` Claudio Roberto França Pereira
2011-11-08 6:01 ` Pandu Poluan [this message]
2011-11-08 6:03 ` Pandu Poluan
2011-10-12 5:42 ` Manuel McLure
2011-10-12 5:45 ` meino.cramer
2011-10-12 6:04 ` William Kenworthy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAA2qdGX+ej080ZsvguuCjB_qhLWZZT2y2g4EWJoVZ62Wm3d7Mw@mail.gmail.com \
--to=pandu@poluan.info \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox