Bash-4.4 distribution sources and documentation
This commit is contained in:
parent
30a978b7d8
commit
a0c0a00fc4
588 changed files with 130746 additions and 80164 deletions
43
tests/nameref14.sub
Normal file
43
tests/nameref14.sub
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# exporting namerefs and putting namerefs in temp env post bash-4.3
|
||||
|
||||
typeset -nx ref=var;
|
||||
typeset -p ref
|
||||
|
||||
var=foo; str=''
|
||||
printenv ref # var
|
||||
ref+=$str printenv ref # var
|
||||
ref+="$str" printenv ref # var
|
||||
ref=$ref$str printenv ref # var
|
||||
|
||||
export ref # follows nameref and exports var
|
||||
|
||||
printenv var # foo
|
||||
ref+=$str printenv var # foo
|
||||
ref+="$str" printenv var # foo
|
||||
ref=$ref$str printenv var # foo
|
||||
|
||||
# none of these should change ref; should follow the nameref and export var
|
||||
unset var; unset -n ref; typeset -n ref=var
|
||||
|
||||
echo before
|
||||
typeset -p ref var
|
||||
|
||||
echo first
|
||||
ref=xxx typeset -p ref var
|
||||
|
||||
echo invalid
|
||||
var= ref=5 typeset -p ref var
|
||||
|
||||
echo after
|
||||
typeset -p ref var
|
||||
|
||||
# ref isn't exported, so none of the printenvs should print anything
|
||||
unset var ; unset -n ref
|
||||
typeset -n ref=var;
|
||||
typeset -p ref
|
||||
|
||||
var=foo; str=''
|
||||
printenv ref
|
||||
ref+=$str printenv ref
|
||||
ref+="$str" printenv ref
|
||||
ref=$ref$str printenv ref
|
||||
Loading…
Add table
Add a link
Reference in a new issue