summaryrefslogtreecommitdiffstats
path: root/tests/histexp.right
blob: 341252c0d2ca70476f150fc086730800dd266d3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
echo $BASH_VERSION
./histexp.tests: line 37: history: !!:z: history expansion failed
    1  for i in one two three; do echo $i; done
    2  /bin/sh -c 'echo this is $0'
    3  ls
    4  echo $BASH_VERSION
    1  for i in one two three; do echo $i; done
    2  /bin/sh -c 'echo this is $0'
    3  ls
    4  echo $BASH_VERSION
    5  HISTFILE=$TMPDIR/newhistory
    6  echo line 2 for history
echo line 2 for history
echo line 2 for history
set -H
echo line 2 for history
line 2 for history
    1  for i in one two three; do echo $i; done
    2  /bin/sh -c 'echo this is $0'
    3  ls
    4  echo $BASH_VERSION
    5  HISTFILE=$TMPDIR/newhistory
    6  echo line 2 for history
    7  set -H
    8  echo line 2 for history
a b c d e
echo a b c d e
a b c d e
echo line 2 for history
line 2 for history
echo line 8 for history
line 8 for history
/bin/sh -c 'echo this is $0'
this is /bin/sh
echo sh
sh
echo /bin
/bin
echo e
e
a b c d e
echo b c d e
b c d e
echo b c d
b c d
echo d e
d e
echo d e
d e
echo b c d
b c d
file.c
echo file
file
echo .c
.c
echo 'file'
file
bax.c
echo $file
bax
echo .c
.c
echo '$file'
$file
a b c d e
echo 'a' 'b' 'c' 'd' 'e'
a b c d e
echo 'a b c d e'
a b c d e
foo.c foo.o foo.html foo.h
echo bar.c foo.o foo.html foo.h
bar.c foo.o foo.html foo.h
echo bar.c bar.o bar.html bar.h
bar.c bar.o bar.html bar.h
echo xbar.c xbar.o xbar.html xbar.h
xbar.c xbar.o xbar.html xbar.h
echo xbar.c xbar.o xbar.html xbar.h
xbar.c xbar.o xbar.html xbar.h
echo xwhix.c xwhix.o xwhix.html xwhix.h
xwhix.c xwhix.o xwhix.html xwhix.h
echo xwhix.c xwhix.o xwhix.html xwhix.h
echo 'xwhix'
xwhix
echo 'xwhix.h'
xwhix.h
echo 'xwhix.h'
xwhix.h
echo 'xwhix.h'
xwhix.h
    7  set -H
    8  echo line 2 for history
    9  echo a b c d e
   10  echo line 2 for history
   11  echo line 8 for history
   12  /bin/sh -c 'echo this is $0'
   13  echo sh
   14  echo /bin
   15  echo e
   16  echo a b c d e
   17  echo b c d e
   18  echo b c d
   19  echo d e
   20  echo b c d
   21  echo file.c
   22  echo file
   23  echo .c
   24  echo 'file'
   25  echo $file.c
   26  echo $file
   27  echo .c
   28  echo '$file'
   29  echo a b c d e
   30  echo 'a' 'b' 'c' 'd' 'e'
   31  echo 'a b c d e'
   32  echo foo.c foo.o foo.html foo.h
   33  echo bar.c foo.o foo.html foo.h
   34  echo bar.c bar.o bar.html bar.h
   35  echo xbar.c xbar.o xbar.html xbar.h
   36  echo xwhix.c xwhix.o xwhix.html xwhix.h
   37  echo 'xwhix'
   38  echo 'xwhix.h'
!!
!!
echo '!!' \!\!
!! !!
ok 1
ok 2
ok 3
echo shopt a
shopt a
echo a b c d 2> /dev/null
a b c d
one two three four
echo two ; echo four  
one two three four
echo four ; echo two
!
!
!
!
!
!
!
!
!
\!
\!
\!
\!
a
b
c
echo "#!/bin/bash" set -o posix
#!/bin/bash set -o posix
!!
!!
a
echo $(echo echo a)
echo a
a
echo echo a $(echo echo a)
echo a echo a
b
!! $(echo !!)
c
echo "echo c" "$(echo echo c)"
echo c echo c
d
echo "echo d" $(echo "echo d")
echo d echo d
e
!! !!
f
!!
f
!!
g
echo "echo g"
echo g
g
eval echo "echo g"
echo g
h
echo \!\! `echo echo h`
!! echo h
i
echo echo i `echo echo i`
echo i echo i
j
echo `echo j` echo j
j echo j
a
cat < <(echo echo a)
echo a
b
echo echo b `echo echo b`
echo b echo b
c
!
d
!
e
! !
./histexp4.sub: line 33: !': event not found
/tmp/Step1
echo /$(echo tmp)/Step1
/tmp/Step1
echo /<(echo tmp)/Step1 > /dev/null
/tmp/Step1
echo $(echo /tmp)/Step1
/tmp/Step1
echo <(echo /tmp)/Step1 > /dev/null
/+(one|two|three)/Step1
echo /+(one|two|three)/Step1
/+(one|two|three)/Step1
/*(tmp|dev|usr)/Step1
echo /*(tmp|dev|usr)/Step1
/*(tmp|dev|usr)/Step1
+(/one|/two|/three)/Step1
echo +(/one|/two|/three)/Step1
+(/one|/two|/three)/Step1
*(/tmp|/dev|/usr)/Step1
echo *(/tmp|/dev|/usr)/Step1
*(/tmp|/dev|/usr)/Step1
one
	echo echo one
echo one
echo one
echo one
    1  set -o histexpand
    2  echo one
    3  for f in a b c; do 	echo echo one; done
    4  history
two
	echo echo two
echo two
echo two
echo two
    1  echo two
    2  for f in a b c; do 	echo echo two; done
    3  history
a
echo !!
--between--
echo !!