bison-patches
[Top][All Lists]
Advanced

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

examples: beware of shell portability issues


From: Akim Demaille
Subject: examples: beware of shell portability issues
Date: Thu, 6 Sep 2018 13:51:59 +0200

Will be pushed in master.

commit d908fb3f181de1983ab05387d8e962b7cd4587e3
Author: Akim Demaille <address@hidden>
Date:   Sun Sep 2 09:20:06 2018 +0200

    examples: beware of shell portability issues
    
    This completes 2d7e7438024e47650c3a0c9f5f313c6eb6acae2d.
    
    Some shells don't grok "local var=`cmd`" very well: they need the rhs
    to be quoted.
    
        ./examples/test: 72: local: you.,: bad variable name
        FAIL examples/variant.test (exit status: 2)
    
    Reported by Étienne Renault.
    
    * examples/test (run): Quote the values in 'local' assignments.

diff --git a/examples/test b/examples/test
index e4ffa259..cd3d17dd 100755
--- a/examples/test
+++ b/examples/test
@@ -69,7 +69,7 @@ run ()
   local sta_eff=0
   $prog "$@" - <input >out_eff || sta_eff=$?
   # Effective output.
-  local out_eff=`cat out_eff`
+  local out_eff="`cat out_eff`"
   if test $sta_eff -eq $sta_exp; then
     if test "$out_eff" = "$out_exp"; then
       echo "$me: PASS: $number"




reply via email to

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