ENOSIG Discussie (threads)


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

bash append


Hi enosiggers,

I'm stuck with this simple bash script :

cat append.sh 
#!/bin/bash
set -x
declare -gx TODO="Todo:"
TODO+=' aap.'
[ -f /isernie ] || (
    TODO+=' noot.'
)
TODO+=' mies.'
echo "[$TODO]"

Output is :

./append.sh 
+ set -x
+ declare -gx TODO=Todo:
+ TODO+=' aap.'
+ '[' -f /isernie ']'
+ TODO+=' noot.'
+ TODO+=' mies.'
+ echo '[Todo: aap. mies.]'
[Todo: aap. mies.]

Afaik bash does not have name scoping.

What must I do to have 'noot' appended here ?

ps. this is on GNU bash, version 4.2.37(1)-release

-- Hans


Follow-ups:


[ Date Index] [ Thread Index]