From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v3 2/3] apply-patches.sh: Use [[...]] construct instead of [...] construct
Date: Thu, 31 Jul 2014 19:28:42 +0200 [thread overview]
Message-ID: <20140731172842.GE3960@free.fr> (raw)
In-Reply-To: <00392aed-ce27-4eea-985b-75f06f79e0d7@email.android.com>
Thomas, All,
On 2014-07-31 19:19 +0200, Thomas De Schampheleire spake thusly:
> Fabio Porcedda <fabio.porcedda@gmail.com> schreef:
> >The [[...]] construct it's an improved and safer construct than the
> >[...] construct. It's safer because it doesn't do "word splitting" so
> >we don't need to enclose variable expansion with double quotes, e.g:
> >
> > [ -e "$file" ] -> [[ -e $file ]]
> >---
>
>
> I'm not so convinced by this patch. [[]] is a bashism, it is not
> supported in all shells.
Well, apply-patches is bash script (it has the correct sha-bang.)
But it is almost POSIX. The only bashism currently used is the
'function' keyword to declare functions. REmove this, and we have a
POSIX script.
> Yes, using single brackets means that you need to take care,
> but anyway shell programming has many pitfalls.
>
> In the past people have sent patches to make Buildroot
> more compatible with non-bash shells, so moving in the opposite
> direction is not a good idea IMO.
Agreed. Besides, the gains from that change are not worth it, IMHO.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2014-07-31 17:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 17:08 [Buildroot] [PATCH v3 0/3] apply-patches.sh: be quiet when "make -s" is used Fabio Porcedda
2014-07-31 17:08 ` [Buildroot] [PATCH v3 1/3] apply-patches.sh: Use the "APPLY_PATCHES" variable to call the script Fabio Porcedda
2014-07-31 17:08 ` [Buildroot] [PATCH v3 2/3] apply-patches.sh: Use [[...]] construct instead of [...] construct Fabio Porcedda
2014-07-31 17:19 ` Thomas De Schampheleire
2014-07-31 17:28 ` Yann E. MORIN [this message]
2014-08-01 10:34 ` Fabio Porcedda
2014-07-31 17:08 ` [Buildroot] [PATCH v3 3/3] apply-patches.sh: don't print anything when "make -s" is used Fabio Porcedda
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=20140731172842.GE3960@free.fr \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/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