From: Paul Eggleton <paul.eggleton@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] scripts/contrib/*: fix arithmetic bashism
Date: Wed, 17 Jul 2013 18:29:37 +0100 [thread overview]
Message-ID: <1374082177-6873-1-git-send-email-paul.eggleton@linux.intel.com> (raw)
Apparently $[...] isn't valid in dash, so use $((...)) instead for
mkefidisk.sh and ddimage that both start with $!/bin/sh.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
scripts/contrib/ddimage | 2 +-
scripts/contrib/mkefidisk.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage
index ab1d4c7..93ebeaf 100755
--- a/scripts/contrib/ddimage
+++ b/scripts/contrib/ddimage
@@ -39,7 +39,7 @@ device_details() {
echo " model: UNKNOWN"
fi
if [ -f "/sys/class/block/$DEV/size" ]; then
- echo " size: $[$(cat /sys/class/block/$DEV/size)*BLOCK_SIZE] bytes"
+ echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes"
else
echo " size: UNKNOWN"
fi
diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh
index 0c15104..bcc2411 100755
--- a/scripts/contrib/mkefidisk.sh
+++ b/scripts/contrib/mkefidisk.sh
@@ -64,7 +64,7 @@ function device_details() {
echo " model: UNKNOWN"
fi
if [ -f "/sys/class/block/$DEV/size" ]; then
- echo " size: $[$(cat /sys/class/block/$DEV/size)*BLOCK_SIZE] bytes"
+ echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes"
else
echo " size: UNKNOWN"
fi
--
1.8.1.2
reply other threads:[~2013-07-17 17:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1374082177-6873-1-git-send-email-paul.eggleton@linux.intel.com \
--to=paul.eggleton@linux.intel.com \
--cc=openembedded-core@lists.openembedded.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