From: Milian Wolff Date: Thu, 2 Jun 2016 10:02:07 +0000 (+0200) Subject: Make heaptrack.sh shell script work with dash. X-Git-Tag: submit/tizen/20180620.112952^2~174 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=193a7aebe80adc3680e11dba3e0d80cc7d2c9a23;p=sdk%2Ftools%2Fheaptrack.git Make heaptrack.sh shell script work with dash. --- diff --git a/heaptrack.sh.cmake b/heaptrack.sh.cmake index 20151fc..9ff6577 100755 --- a/heaptrack.sh.cmake +++ b/heaptrack.sh.cmake @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Copyright 2014 Milian Wolff @@ -91,7 +91,7 @@ while true; do exit 0 ;; *) - if [[ "$1" == "--" ]]; then + if [ "$1" = "--" ]; then shift 1 fi if [ ! -x "$(which "$1" 2> /dev/null)" ]; then @@ -145,13 +145,13 @@ output="$output.gz" "$INTERPRETER" < $pipe | gzip -c > "$output" & debuggee=$! -function cleanup { +cleanup() { rm -f "$pipe" kill "$debuggee" 2> /dev/null echo "Heaptrack finished! Now run the following to investigate the data:" echo - if [[ "$(which heaptrack_gui 2> /dev/null)" != "" ]]; then + if [ "$(which heaptrack_gui 2> /dev/null)" != "" ]; then echo " heaptrack_gui \"$output\"" else echo " heaptrack_print \"$output\" | less"