From 3a593fff42c04e64f402d41718973ad21987b073 Mon Sep 17 00:00:00 2001 From: devzero2000 Date: Fri, 28 Mar 2014 17:10:13 +0000 Subject: This patch series changes everywhere the back-quotes construct for command substitution with the $( ... ). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- autogen.sh | 8 ++++---- testit.sh | 10 +++++----- 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 @@ -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 -- cgit v1.2.1