Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Omar Sandoval <osandov@osandov.com>
Cc: "Florian Gamböck" <ml@floga.de>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Fix bashism in fsck.btrfs for debian/ubuntu dash.
Date: Wed, 20 May 2015 18:49:29 +0200	[thread overview]
Message-ID: <20150520164928.GL23255@twin.jikos.cz> (raw)
In-Reply-To: <20150516085828.GA14823@mew>

On Sat, May 16, 2015 at 01:58:28AM -0700, Omar Sandoval wrote:
> On Sat, May 16, 2015 at 10:27:11AM +0200, Florian Gamböck wrote:
> > 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
> > 
> 
> Whoops, you're totally right, that was a typo. I meant
> 
> if ! $AUTO; then

That's my preference as it was implemented originally. I did not pay
close attention to how it was implemented in "silence fake fsck" as far
as it worked.

  reply	other threads:[~2015-05-20 16:49 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
2015-05-16  8:58     ` Omar Sandoval
2015-05-20 16:49       ` David Sterba [this message]
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=20150520164928.GL23255@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=ml@floga.de \
    --cc=osandov@osandov.com \
    /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