From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] fsck.btrfs: Fix bashism and bad getopts processing
Date: Thu, 21 May 2015 13:50:55 +0100 [thread overview]
Message-ID: <1432212655-6238-1-git-send-email-dimitri.j.ledkov@intel.com> (raw)
In-Reply-To: <20150521115651.GP23255@twin.jikos.cz>
First fix == bashism, as that is not accepted by e.g. Debian/Ubuntu
dash.
Secondly shift OPTIND, such that last parameter is checked to exist.
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
---
fsck.btrfs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fsck.btrfs b/fsck.btrfs
index f056a7f..20b070a 100755
--- a/fsck.btrfs
+++ b/fsck.btrfs
@@ -26,12 +26,13 @@ do
a|A|p|y) AUTO=true;;
esac
done
+shift $(($OPTIND -1))
eval DEV=\${$#}
if [ ! -e $DEV ]; then
echo "$0: $DEV does not exist"
exit 8
fi
-if [ "$AUTO" == "false" ]; then
+if ! $AUTO; then
echo "If you wish to check the consistency of a BTRFS filesystem or"
echo "repair a damaged filesystem, see btrfs(8) subcommand 'check'."
fi
--
2.1.4
next prev parent reply other threads:[~2015-05-21 12:50 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
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 ` Dimitri John Ledkov [this message]
2015-05-21 14:40 ` [PATCH] fsck.btrfs: Fix bashism and bad getopts processing 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=1432212655-6238-1-git-send-email-dimitri.j.ledkov@intel.com \
--to=dimitri.j.ledkov@intel.com \
--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