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.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to