From e2f4e88a55cc91b39f5d8a1717eadd2f1fd25eae Mon Sep 17 00:00:00 2001 From: Zhao Lei Date: Wed, 23 Sep 2015 19:11:50 +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: If3a914650749d72c2eb13b9f1307ef7b4319bd2f Signed-off-by: Zhao Lei --- playbooks/roles/repo_server/files/openstack-wheel-builder.sh | 2 +- scripts/scripts-library.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/repo_server/files/openstack-wheel-builder.sh b/playbooks/roles/repo_server/files/openstack-wheel-builder.sh index 139db8483b..b4abf2a663 100644 --- a/playbooks/roles/repo_server/files/openstack-wheel-builder.sh +++ b/playbooks/roles/repo_server/files/openstack-wheel-builder.sh @@ -97,7 +97,7 @@ function kill_job { set +e # If the job needs killing kill the pid and unlock the file. if [ -f "${LOCKFILE}" ]; then - PID="$(cat ${LOCKFILE})" + PID=$(cat ${LOCKFILE}) lock_file_remove kill -9 "${PID}" fi diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 4f116ea2ac..5bd169c66e 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -31,7 +31,7 @@ FORKS=${FORKS:-$(grep -c ^processor /proc/cpuinfo)} function successerator { set +e # Get the time that the method was started. - OP_START_TIME="$(date +%s)" + OP_START_TIME=$(date +%s) RETRY=0 # Set the initial return value to failure. false