From 65ae375828a18c1cb23b908cdad7188a07c0ee7f Mon Sep 17 00:00:00 2001 From: LE Manh Cuong Date: Mon, 19 Oct 2015 16:52:26 +0700 Subject: [PATCH] Fix some minor issues: - Missing double quote - Replace `echo -n` with `printf "%s"` for more portability and reliability --- bin/_blackbox_common.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/_blackbox_common.sh b/bin/_blackbox_common.sh index b18c5e5..183ed8d 100755 --- a/bin/_blackbox_common.sh +++ b/bin/_blackbox_common.sh @@ -28,7 +28,7 @@ source "${0%/*}"/_stack_lib.sh function physical_directory_of() { local d=$(dirname "$1") local f=$(basename "$1") - (cd "$d" && echo $(pwd -P)"/$f" ) + (cd "$d" && echo "$(pwd -P)/$f" ) } # Set REPOBASE to the top of the repository @@ -330,10 +330,10 @@ function vcs_relative_path() { # Usage: vcs_relative_path file local name="$1" #python -c 'import os ; print(os.path.relpath("'"$(pwd -P)"'/'"$name"'", "'"$REPOBASE"'"))' - local p=$( echo -n "$( pwd -P )/${1}" | sed 's#//*#/#g' ) + local p=$( printf "%s" "$( pwd -P )/${1}" | sed 's#//*#/#g' ) local name="${p#$REPOBASE}" - name=$( echo -n "$name" | sed 's#^/##g' | sed 's#/$##g' ) - echo -n $name + name=$( printf "%s" "$name" | sed 's#^/##g' | sed 's#/$##g' ) + printf "%s" "$name" } # Removes a line from a text file