coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: amendments to backtick-removing series


From: Jim Meyering
Subject: Re: amendments to backtick-removing series
Date: Wed, 04 Apr 2012 15:30:53 +0200

Andreas Schwab wrote:
> Jim Meyering <address@hidden> writes:
>
>> 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")
>      eval rev=\$REV_$opt
>
>> @@ -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")
>          eval rev1=\$REV_$opt1
>          eval rev2=\$REV_$opt2

Thanks.  I've converted that to a git commit for you:

>From d6f3240af33e81cc294aace9d969ff465e016614 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <address@hidden>
Date: Wed, 4 Apr 2012 15:06:17 +0200
Subject: [PATCH] tests: avoid unnecessary subshells in misc/stty

* tests/misc/stty: Don't waste a subshell to perform this:
eval rev=\$REV_$opt.  Fix rev1,rev2 assignments similarly.
---
 tests/misc/stty |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/misc/stty b/tests/misc/stty
index 97020e8..fa66a1a 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")
+  eval \$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")
+      eval \$REV_$opt1
+      eval \$REV_$opt2
       if test -n "$rev1"; then
         stty -$opt1 $opt2 || fail=1
       fi
--
1.7.9.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]