Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / nameref6.sub
1 # these should be errors
2 typeset -n x=x
3 #echo $x -- $?
4
5 typeset -n x[3]=x
6 #echo $x -- $?
7
8 x=(the browns suck)
9 y=(one two three)
10 # should be an error but not disturb the current contents of x
11 # maybe rethink that later
12 typeset -n x=y
13 echo $x -- $?
14
15 typeset -n
16
17 unset x y
18
19 y=42
20 typeset -i x=1
21
22 # the integer attribute causes arithmetic eval to be done
23 # we should not allow namerefs to non-identifiers
24 typeset -n x=y
25 echo $x -- $?
26
27 typeset +n x
28 echo $x -- $?
29
30 # same kind of thing
31
32 unset -n x
33 unset y
34
35 set -- first second third
36 y=2
37 typeset -i x=1
38
39 typeset -n x=y
40 echo $x -- $?
41 echo ${x} -- $?
42
43 typeset +n x
44 echo $x -- $?