tests: avoid unnecessary subshells in misc/stty
authorAndreas Schwab <schwab@linux-m68k.org>
Wed, 4 Apr 2012 13:06:17 +0000 (15:06 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 4 Apr 2012 14:09:49 +0000 (16:09 +0200)
* tests/misc/stty: Don't waste a subshell to perform this:
eval rev=\$REV_$opt.  Fix rev1,rev2 assignments similarly.

tests/misc/stty

index 97020e8..1b082c2 100755 (executable)
@@ -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=\$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 rev1=\$REV_$opt1
+      eval rev2=\$REV_$opt2
       if test -n "$rev1"; then
         stty -$opt1 $opt2 || fail=1
       fi