From: "Florian Gamböck" <ml@floga.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Fix bashism in fsck.btrfs for debian/ubuntu dash.
Date: Sat, 16 May 2015 10:27:11 +0200 [thread overview]
Message-ID: <5556FF5F.1050907@floga.de> (raw)
In-Reply-To: <20150515204340.GA20386@mew.dhcp4.washington.edu>
Am 15.05.2015 um 22:43 schrieb Omar Sandoval:
> I'm going to completely bikeshed here, but Yoda conditions are already
> ugly in C, and completely pointless in Bash, where you can't ever
> accidentally reassign a variable in a condition. Either way, I think:
>
> if [ ! $AUTO ]; then
>
> would be clearer anyways.
Ah, I'm sorry to disagree with you, but your code snippet would only
work if $AUTO is *empty*, and I think, to be totally correct you'd have
to use the -n or -z test.
To sum it up now, you'd have to replace "false" with an empty string in
the beginning of the file and the zero-test in the end. So something
like the following:
AUTO=
# ...
if [ -z "$AUTO" ]; then
Regards
--Flo
next prev parent reply other threads:[~2015-05-16 8:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 20:28 [PATCH] Fix bashism in fsck.btrfs for debian/ubuntu dash Dimitri John Ledkov
2015-05-15 20:43 ` Omar Sandoval
2015-05-16 8:27 ` Florian Gamböck [this message]
2015-05-16 8:58 ` Omar Sandoval
2015-05-20 16:49 ` David Sterba
2015-05-16 9:14 ` Markus Baertschi
2015-05-21 8:19 ` Dimitri John Ledkov
2015-05-21 11:56 ` David Sterba
2015-05-21 12:50 ` [PATCH] fsck.btrfs: Fix bashism and bad getopts processing Dimitri John Ledkov
2015-05-21 14:40 ` David Sterba
2015-05-25 12:28 ` David Sterba
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=5556FF5F.1050907@floga.de \
--to=ml@floga.de \
--cc=linux-btrfs@vger.kernel.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