Use $(COMMAND) instead of COMMAND

The usage of $(COMMAND) shoud be preferred. Details can be
found at http://mywiki.wooledge.org/BashFAQ/082.

Also replaced two ` used in strings with '.

Change-Id: Ia729470c58da6fe2e505426bd5ce93214ec1f655
This commit is contained in:
Christian Berendt 2014-09-30 15:17:04 +02:00
parent b478447fcc
commit c06f8e7bec
3 changed files with 13 additions and 13 deletions

View File

@ -128,15 +128,15 @@ function run_tests {
# Just run the test suites in current environment
set +e
testrargs=`echo "$testrargs" | sed -e's/^\s*\(.*\)\s*$/\1/'`
testrargs=$(echo "$testrargs" | sed -e's/^\s*\(.*\)\s*$/\1/')
TESTRTESTS="$TESTRTESTS --testr-args='--subunit $testropts $testrargs'"
OS_TEST_PATH=`echo $testrargs|grep -o 'mistral\.tests[^[:space:]:]*\+'|tr . /`
OS_TEST_PATH=$(echo $testrargs|grep -o 'mistral\.tests[^[:space:]:]*\+'|tr . /)
if [ -d "$OS_TEST_PATH" ]; then
wrapper="OS_TEST_PATH=$OS_TEST_PATH $wrapper"
elif [ -d "$(dirname $OS_TEST_PATH)" ]; then
wrapper="OS_TEST_PATH=$(dirname $OS_TEST_PATH) $wrapper"
fi
echo "Running \`${wrapper} $TESTRTESTS\`"
echo "Running ${wrapper} $TESTRTESTS"
bash -c "${wrapper} $TESTRTESTS | ${wrapper} subunit2pyunit"
RESULT=$?
set -e
@ -154,7 +154,7 @@ function run_tests {
}
function copy_subunit_log {
LOGNAME=`cat .testrepository/next-stream`
LOGNAME=$(cat .testrepository/next-stream)
LOGNAME=$(($LOGNAME - 1))
LOGNAME=".testrepository/${LOGNAME}"
cp $LOGNAME subunit.log

View File

@ -12,7 +12,7 @@ else
exit 1
fi
TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX`
TEMPDIR=$(mktemp -d /tmp/${PROJECT_NAME}.XXXXXX)
trap "rm -rf $TEMPDIR" EXIT
tools/config/generate_sample.sh -b ./ -p ${PROJECT_NAME} -o ${TEMPDIR}

View File

@ -11,7 +11,7 @@
# MISTRAL_CONFIG_GENERATOR_EXCLUDED_FILES: list of files to remove from automatic listing.
print_hint() {
echo "Try \`${0##*/} --help' for more information." >&2
echo "Try '${0##*/} --help' for more information." >&2
}
PARSED_OPTIONS=$(getopt -n "${0##*/}" -o hb:p:m:l:o: \
@ -37,17 +37,17 @@ while true; do
;;
-b|--base-dir)
shift
BASEDIR=`echo $1 | sed -e 's/\/*$//g'`
BASEDIR=$(echo $1 | sed -e 's/\/*$//g')
shift
;;
-p|--package-name)
shift
PACKAGENAME=`echo $1`
PACKAGENAME=$(echo $1)
shift
;;
-o|--output-dir)
shift
OUTPUTDIR=`echo $1 | sed -e 's/\/*$//g'`
OUTPUTDIR=$(echo $1 | sed -e 's/\/*$//g')
shift
;;
-m|--module)
@ -66,7 +66,7 @@ while true; do
esac
done
BASEDIR=${BASEDIR:-`pwd`}
BASEDIR=${BASEDIR:-$(pwd)}
if ! [ -d $BASEDIR ]
then
echo "${0##*/}: missing project base directory" >&2 ; print_hint ; exit 1
@ -90,16 +90,16 @@ then
OUTPUTDIR=$OUTPUTDIR/$PACKAGENAME
elif ! [ -d $OUTPUTDIR ]
then
echo "${0##*/}: cannot access \`$OUTPUTDIR': No such file or directory" >&2
echo "${0##*/}: cannot access '$OUTPUTDIR': No such file or directory" >&2
exit 1
fi
BASEDIRESC=`echo $BASEDIR | sed -e 's/\//\\\\\//g'`
BASEDIRESC=$(echo $BASEDIR | sed -e 's/\//\\\\\//g')
find $TARGETDIR -type f -name "*.pyc" -delete
FILES=$(find $TARGETDIR -type f -name "*.py" ! -path "*/tests/*" \
-exec grep -l "Opt(" {} + | sed -e "s/^$BASEDIRESC\///g" | sort -u)
RC_FILE="`dirname $0`/oslo.config.generator.rc"
RC_FILE="$(dirname $0)/oslo.config.generator.rc"
if test -r "$RC_FILE"
then
source "$RC_FILE"