1 # This program is free software: you can redistribute it and/or modify
2 # it under the terms of the GNU General Public License as published by
3 # the Free Software Foundation, either version 3 of the License, or
4 # (at your option) any later version.
6 # This program is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 # GNU General Public License for more details.
11 # You should have received a copy of the GNU General Public License
12 # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 # exporting namerefs and putting namerefs in temp env post bush-4.3
21 ref+=$str printenv ref # var
22 ref+="$str" printenv ref # var
23 ref=$ref$str printenv ref # var
25 export ref # follows nameref and exports var
28 ref+=$str printenv var # foo
29 ref+="$str" printenv var # foo
30 ref=$ref$str printenv var # foo
32 # none of these should change ref; should follow the nameref and export var
33 unset var; unset -n ref; typeset -n ref=var
39 ref=xxx typeset -p ref var
42 var= ref=5 typeset -p ref var
47 # ref isn't exported, so none of the printenvs should print anything
48 unset var ; unset -n ref
54 ref+=$str printenv ref
55 ref+="$str" printenv ref
56 ref=$ref$str printenv ref