scripts: bin2png.sh: Fix POSIX shell compliance
authorKieran Bingham <kieran.bingham@ideasonboard.com>
Wed, 22 Feb 2017 15:52:43 +0000 (15:52 +0000)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 22 Feb 2017 17:37:19 +0000 (19:37 +0200)
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>
scripts/bin2png.sh

index 090f31f..6422ee5 100755 (executable)
@@ -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|')