From a0e99db0d4fb9fcdafa5bf4d5a010857f7fb1ed7 Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Wed, 23 Sep 2015 17:53:43 +0800 Subject: [PATCH] Remove quotes from subshell call in bash script Always no quotes for $() statement. We don't need quotes to hold blanks in result: # i=$(echo 1 2 3) # echo $i 1 2 3 # These quotes can make something wrong in some case: # i=$(echo '!') # # i="$(echo '!')" -bash: !: event not found # No real problem for current code, only to use a better code style. Change-Id: Iabb98ba4db4f04b4f10c944184356dab648af3a6 Signed-off-by: Zhao Lei --- install_rally.sh | 4 ++-- samples/plugins/unpack_plugins_samples.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install_rally.sh b/install_rally.sh index ba91adf5fe..aa26fd8972 100755 --- a/install_rally.sh +++ b/install_rally.sh @@ -28,8 +28,8 @@ GREEN="$ESC[0;32m" NO_COLOR="$ESC[0;0m" RED="$ESC[0;31m" -PYTHON2="$(which python || true)" -PYTHON3="$(which python3 || true)" +PYTHON2=$(which python || true) +PYTHON3=$(which python3 || true) PYTHON=${PYTHON2:-$PYTHON3} BASE_PIP_URL=${BASE_PIP_URL:-"https://pypi.python.org/simple"} VIRTUALENV_191_URL="https://raw.github.com/pypa/virtualenv/1.9.1/virtualenv.py" diff --git a/samples/plugins/unpack_plugins_samples.sh b/samples/plugins/unpack_plugins_samples.sh index 09a9bc2a39..8b126a26c3 100644 --- a/samples/plugins/unpack_plugins_samples.sh +++ b/samples/plugins/unpack_plugins_samples.sh @@ -1,5 +1,5 @@ #!/bin/bash -samples_unpacked_dir="$(dirname "${BASH_SOURCE[0]}" )" +samples_unpacked_dir=$(dirname "${BASH_SOURCE[0]}") dirs=( $(find "$samples_unpacked_dir" -maxdepth 1 -type d -printf '%P\n') ) samples=~/.rally/plugins/samples mkdir -p "$samples"