]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/braces.tests
Imported from ../bash-3.2.tar.gz.
[thirdparty/bash.git] / tests / braces.tests
1 echo ff{c,b,a}
2 echo f{d,e,f}g
3 echo {l,n,m}xyz
4 echo {abc\,def}
5 echo {abc}
6
7 echo \{a,b,c,d,e}
8 echo {x,y,\{a,b,c}}
9 echo {x\,y,\{abc\},trie}
10
11 echo /usr/{ucb/{ex,edit},lib/{ex,how_ex}}
12
13 echo XXXX\{`echo a b c | tr ' ' ','`\}
14 eval echo XXXX\{`echo a b c | tr ' ' ','`\}
15
16 echo {}
17 echo { }
18 echo }
19 echo {
20 echo abcd{efgh
21
22 echo foo {1,2} bar
23 echo `zecho foo {1,2} bar`
24 echo $(zecho foo {1,2} bar)
25
26 var=baz
27 varx=vx
28 vary=vy
29
30 echo foo{bar,${var}.}
31 echo foo{bar,${var}}
32
33 echo "${var}"{x,y}
34 echo $var{x,y}
35 echo ${var}{x,y}
36
37 unset var varx vary
38
39 # new sequence brace operators
40 echo {1..10}
41
42 # this doesn't work yet
43 echo {0..10,braces}
44 # but this does
45 echo {{0..10},braces}
46 echo x{{0..10},braces}y
47
48 echo {3..3}
49 echo x{3..3}y
50 echo {10..1}
51 echo {10..1}y
52 echo x{10..1}y
53
54 echo {a..f}
55 echo {f..a}
56
57 echo {a..A}
58 echo {A..a}
59
60 echo {f..f}
61
62 # mixes are incorrectly-formed brace expansions
63 echo {1..f}
64 echo {f..1}
65
66 echo 0{1..9} {10..20}
67
68 # do negative numbers work?
69 echo {-1..-10}
70 echo {-20..0}
71
72 # weirdly-formed brace expansions -- fixed in post-bash-3.1
73 echo a-{b{d,e}}-c
74
75 echo a-{bdef-{g,i}-c