~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to tests/casemod.tests

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
S1=acknowledgement
 
2
S2=oenophile
 
3
 
 
4
echo ${S1^}
 
5
echo ${S1^^}
 
6
 
 
7
echo ${S2^[aeiou]}
 
8
echo ${S2^^[aeiou]}
 
9
 
 
10
U1=${S1^^}
 
11
U2=${S2^^}
 
12
 
 
13
echo ${U1,}
 
14
echo ${U1,,}
 
15
 
 
16
echo ${U2,}
 
17
echo ${U2,[AEIOU]}
 
18
echo ${U2,,[AEIOU]}
 
19
 
 
20
A1=( $S1 $S2 )
 
21
 
 
22
echo ${A1[@]^[aeiou]}
 
23
echo ${A1[@]^^[aeiou]}
 
24
 
 
25
A2=( $U1 $U2 )
 
26
 
 
27
echo ${A2[@],[AEIOU]}
 
28
echo ${A2[@],,[AEIOU]}
 
29
 
 
30
echo ${A2[@],?}
 
31
echo ${A2[@],,?}
 
32
 
 
33
declare -A AA1 AA2
 
34
 
 
35
AA1[ack]=$S1
 
36
AA1[oen]=$S2
 
37
 
 
38
echo ${AA1[@]^}
 
39
echo ${AA1[@]^^}
 
40
 
 
41
echo ${AA1[@]^[aeiou]}
 
42
echo ${AA1[@]^^[aeiou]}
 
43
 
 
44
AA2[ACK]=$U1
 
45
AA2[OEN]=$U2
 
46
 
 
47
echo ${AA2[@],}
 
48
echo ${AA2[@],,}
 
49
 
 
50
echo ${AA2[@],[AEIOU]}
 
51
echo ${AA2[@],,[AEIOU]}
 
52
 
 
53
set -- $S1 $S2
 
54
 
 
55
echo ${@^}
 
56
echo ${@^^}
 
57
 
 
58
 
 
59
echo ${S1^[rstlne]} ${S2^[rstlne]}
 
60
echo ${S1^^[rstlne]} ${S2^^[rstlne]}
 
61
 
 
62
echo ${@^[rstlne]}
 
63
echo ${@^^[rstlne]}
 
64
 
 
65
echo ${S1,[rstlne]} ${S2,[rstlne]}
 
66
echo ${S1,,[rstlne]} ${S2,,[rstlne]}
 
67
 
 
68
echo ${@,[rstlne]}
 
69
echo ${@,,[rstlne]}
 
70
 
 
71
echo ${@^?}
 
72
echo ${@^^?}
 
73
 
 
74
# make sure that multiple words in the string are handled as other expansions
 
75
TEXT="Be Conservative in what you send and Liberal in what you accept"
 
76
TEXT2="be conservative in what you send and liberal in what you accept"
 
77
 
 
78
declare -u foo
 
79
foo=$TEXT
 
80
echo $foo
 
81
 
 
82
declare -l bar
 
83
bar=$TEXT
 
84
echo $bar
 
85
 
 
86
declare -c qux
 
87
qux=$TEXT
 
88
echo $qux
 
89
qux=$TEXT2
 
90
echo $qux
 
91
 
 
92
echo ${TEXT,}
 
93
echo ${TEXT,,}
 
94
 
 
95
echo ${TEXT^}
 
96
echo ${TEXT^^}
 
97
 
 
98
echo ${TEXT2^}
 
99
echo ${TEXT2^^}