summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordevzero2000 <devzero2000>2014-03-28 17:10:13 +0000
committerdevzero2000 <devzero2000>2014-03-28 17:10:13 +0000
commit3a593fff42c04e64f402d41718973ad21987b073 (patch)
tree367fae4e3042158bec739eb1d8f7b1b328994057
parent6c2ff1581491ceed4ac1318da2de98c148fe4085 (diff)
downloadlibpopt-3a593fff42c04e64f402d41718973ad21987b073.tar.gz
This patch series changes everywhere the back-quotes construct for command
substitution with the $( ... ). The backquoted form is the historical method for command substitution, and is supported by POSIX. However, all but the simplest uses become complicated quickly. In particular, embedded command substitutions and/or the use of double quotes require careful escaping with the backslash character. Because of this the POSIX shell adopted the $(…) feature from the Korn shell. Because this construct uses distinct opening and closing delimiters, it is much easier to follow. Also now the embedded double quotes no longer need escaping.
-rwxr-xr-xautogen.sh8
-rwxr-xr-xtestit.sh10
2 files changed, 9 insertions, 9 deletions
diff --git a/autogen.sh b/autogen.sh
index 996a74c..71b782c 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# $Id: autogen.sh,v 1.29 2013/07/03 16:50:20 devzero2000 Exp $
+# $Id: autogen.sh,v 1.30 2014/03/28 17:10:13 devzero2000 Exp $
# autogen.sh: autogen.sh script for popt projects
#
# Copyright (c) 2010-2011 Elia Pinto <devzero2000@rpm5.org>
@@ -106,7 +106,7 @@ check_versions() {
while read app req_ver; do
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
- appvar=`echo $app | tr '[a-z]' '[A-Z]'`
+ appvar=$(echo $app | tr '[a-z]' '[A-Z]')
test "$appvar" = TAR && appvar=AMTAR
eval "app=\${$appvar-$app}"
inst_ver=$(get_version $app)
@@ -159,10 +159,10 @@ else
fi
# Libtool
-libtoolize=`which glibtoolize 2>/dev/null`
+libtoolize=$(which glibtoolize 2>/dev/null)
case $libtoolize in
/*) export LIBTOOL=glibtool;;
- *) libtoolize=`which libtoolize 2>/dev/null`
+ *) libtoolize=$(which libtoolize 2>/dev/null)
case $libtoolize in
/*) ;;
*) libtoolize=libtoolize
diff --git a/testit.sh b/testit.sh
index 0af5f48..eb32d85 100755
--- a/testit.sh
+++ b/testit.sh
@@ -30,14 +30,14 @@ if [ -z "${valgrind_environment}" ]
then
MALLOC_CHECK_=3
export MALLOC_CHECK_
- [ -n "${RANDOM}" ] && MALLOC_PERTURB_=`expr \( $RANDOM % 255 \) + 1 `
+ [ -n "${RANDOM}" ] && MALLOC_PERTURB_=$(expr \( $RANDOM % 255 \) + 1 )
export MALLOC_PERTURB_
#
if [ -z "${MALLOC_PERTURB_}" ] # RANDOM is a bashism
then
- r=`ps -ef | cksum | cut -f1 -d" " 2>/dev/null`
+ r=$(ps -ef | cksum | cut -f1 -d" " 2>/dev/null)
[ -z "${r}" ] && r=1234567890
- MALLOC_PERTURB_=`expr \( $r % 255 \) + 1 `
+ MALLOC_PERTURB_=$(expr \( $r % 255 \) + 1 )
export MALLOC_PERTURB_
fi
fi
@@ -49,7 +49,7 @@ run() {
echo Running test $name.
- result=`HOME=$builddir $builddir/$prog $* 2>&1`
+ result=$(HOME=$builddir $builddir/$prog $* 2>&1)
if [ "$answer" != "$result" ]; then
echo "Test \"$prog $*\" failed with: \"$result\" != \"$answer\" "
@@ -81,7 +81,7 @@ run_diff() {
rm $out $diff_file
}
-builddir=`pwd`
+builddir=$(pwd)
#srcdir=$builddir
cd ${srcdir}
test1=${builddir}/test1