summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2017-02-22 15:52:43 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-02-22 19:37:19 +0200
commit02787fdab3eefae760bd71a49e9d64e09e597257 (patch)
treeedcbe2bbf58c522d7becc1af0bc921c34124192b
parentc64e87519e582a2c6ad02c89549e848a10fd0e00 (diff)
scripts: bin2png.sh: Fix POSIX shell compliance
The string manipulations of the form ${VAR/search/replace} are not posix compliant. Use string deletion, and append instead. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-xscripts/bin2png.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/bin2png.sh b/scripts/bin2png.sh
index 090f31f..6422ee5 100755
--- a/scripts/bin2png.sh
+++ b/scripts/bin2png.sh
@@ -4,8 +4,8 @@ FILE=${1:-.}
convert_image() {
local file=$1
- local pnm=${file/%bin/pnm}
- local png=${file/%bin/png}
+ local pnm=${file%bin}pnm
+ local png=${file%bin}png
local format=$(echo $file | sed -e 's|.*-\([[:alnum:]]*\)-\([0-9]*x[0-9]*\).*.bin|\1|' | tr '[:lower:]' '[:upper:]')
local size=$(echo $file | sed -e 's|.*-\([[:alnum:]]*\)-\([0-9]*x[0-9]*\).*.bin|\2|')