1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
p=1 export p export p=4 declare -p p r=(1) export r f() { export r=(4) ; } f declare -p r f() { export r='(5)' ; } f declare -p r f() { export -a r=(6) ; } f declare -p r f() { export -a r='(7)' ; } f declare -p r