examples: beware of shell portability issues

Some shells don't grok `local var=$val` very well: they need the rhs
to be quoted.

    ./examples/test: 66: 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.
This commit is contained in:
Akim Demaille
2018-09-02 09:20:06 +02:00
parent 50fb434689
commit 2d7e743802
2 changed files with 3 additions and 2 deletions

View File

@@ -60,10 +60,10 @@ cd $$.dir
run ()
{
# Expected exit status.
local sta_exp=$1
local sta_exp="$1"
shift
# Expected output.
local out_exp=$1
local out_exp="$1"
shift
# Effective exit status.
local sta_eff=0