[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
amendments to backtick-removing series
From: |
Jim Meyering |
Subject: |
amendments to backtick-removing series |
Date: |
Wed, 04 Apr 2012 14:36:32 +0200 |
init.cfg need not be exempted, since its functions are
invoked only after init.sh has re-exec'd a usable shell, so
I've converted it, too.
Testing on Solaris 10 exposed problems with quoting
where $( ... "\\\...) behaves differently from ` ..."\\\...`.
That was the impetus for the following change, below.
diff --git a/tests/init.cfg b/tests/init.cfg
index 17713d9..7bcd512 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -235,9 +235,9 @@ rwx_to_mode_()
s='s/S/@/;s/s/x@/;s/@/s/'
t='s/T/@/;s/t/x@/;s/@/t/'
- u=`echo $rwx|sed 's/^.\(...\).*/,u=\1/;s/-//g;s/^,u=$//;'$s`
- g=`echo $rwx|sed 's/^....\(...\).*/,g=\1/;s/-//g;s/^,g=$//;'$s`
- o=`echo $rwx|sed 's/^.......\(...\).*/,o=\1/;s/-//g;s/^,o=$//;'$s';'$t`
+ u=$(echo $rwx|sed 's/^.\(...\).*/,u=\1/;s/-//g;s/^,u=$//;'$s)
+ g=$(echo $rwx|sed 's/^....\(...\).*/,g=\1/;s/-//g;s/^,g=$//;'$s)
+ o=$(echo $rwx|sed 's/^.......\(...\).*/,o=\1/;s/-//g;s/^,o=$//;'$s';'$t)
echo "=$u$g$o"
}
@@ -259,7 +259,7 @@ require_selinux_()
# Independent of whether SELinux is enabled system-wide,
# the current file system may lack SELinux support.
- case `ls -Zd .` in
+ case $(ls -Zd .) in
'? .'|'unlabeled .')
skip_ "this system (or maybe just" \
"the current file system) lacks SELinux support"
@@ -316,7 +316,7 @@ require_membership_in_two_groups_()
{
test $# = 0 || framework_failure_
- groups=${COREUTILS_GROUPS-`(id -G || /usr/xpg4/bin/id -G) 2>/dev/null`}
+ groups=${COREUTILS_GROUPS-$( (id -G || /usr/xpg4/bin/id -G) 2>/dev/null)}
case "$groups" in
*' '*) ;;
*) skip_ 'requires membership in two groups
@@ -389,7 +389,7 @@ require_sparse_support_()
# NTFS requires 128K before a hole appears in a sparse file.
t=sparse.$$
dd bs=1 seek=128K of=$t < /dev/null 2> /dev/null
- set x `du -sk $t`
+ set x $(du -sk $t)
kb_size=$2
rm -f $t
if test $kb_size -ge 128; then
@@ -447,7 +447,7 @@ working_umask_or_skip_()
umask 022
touch file1 file2
chmod 644 file2
- perms=`ls -l file1 file2 | sed 's/ .*//' | uniq`
+ perms=$(ls -l file1 file2 | sed 's/ .*//' | uniq)
rm -f file1 file2
case $perms in
@@ -463,7 +463,7 @@ working_umask_or_skip_()
# an initial delay of .1 second and call it at most 6 times
# with a max delay of 3.2s (doubled each time), or a total of 6.3s
# Note ensure you do _not_ quote the parameter to GNU sleep in
-# your function, as it may contain separate values that `sleep`
+# your function, as it may contain separate values that sleep
# needs to accumulate.
retry_delay_()
{
--
1.7.9.3
diff --git a/tests/misc/stty b/tests/misc/stty
index fe4a4c8..97020e8 100755
--- a/tests/misc/stty
+++ b/tests/misc/stty
@@ -70,7 +70,7 @@ for opt in $options; do
# Likewise, 'stty -cread' would fail, so skip that, too.
test $opt = cread && continue
- rev=$(eval echo "\\\$REV_$opt")
+ rev=$(eval echo "\$REV_$opt")
if test -n "$rev"; then
stty -$opt || { fail=1; echo -$opt; }
fi
@@ -84,8 +84,8 @@ if test -n "$RUN_LONG_TESTS"; then
stty $opt1 $opt2 || fail=1
- rev1=$(eval echo "\\\$REV_$opt1")
- rev2=$(eval echo "\\\$REV_$opt2")
+ rev1=$(eval echo "\$REV_$opt1")
+ rev2=$(eval echo "\$REV_$opt2")
if test -n "$rev1"; then
stty -$opt1 $opt2 || fail=1
fi
- amendments to backtick-removing series,
Jim Meyering <=
- Re: amendments to backtick-removing series, Andreas Schwab, 2012/04/04
- Re: amendments to backtick-removing series, Jim Meyering, 2012/04/04
- Re: amendments to backtick-removing series, Andreas Schwab, 2012/04/04
- Re: amendments to backtick-removing series, Jim Meyering, 2012/04/04
- Re: amendments to backtick-removing series, Bernhard Voelker, 2012/04/04
- Re: amendments to backtick-removing series, Jim Meyering, 2012/04/04
- [PATCH] refactor expensive code in misc/stty [was: amendments to backtick-removing series], Bernhard Voelker, 2012/04/05
- Re: [PATCH] refactor expensive code in misc/stty [was: amendments to backtick-removing series], Jim Meyering, 2012/04/05
- Re: [PATCH] refactor expensive code in misc/stty [was: amendments to backtick-removing series], Bernhard Voelker, 2012/04/05
- Re: [PATCH] refactor expensive code in misc/stty [was: amendments to backtick-removing series], Jim Meyering, 2012/04/05