-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-pipelines-lastpipe.sh
49 lines (49 loc) · 1.03 KB
/
test-pipelines-lastpipe.sh
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
#!/bin/bash
## test-pipelines-lastpipe
## version 0.0.1 - initial
##################################################
func2() {
x=0
}
func() {
x+=1
}
test-pipelines-lastpipe() {
x=0
func | func | func | func
echo ${x}
func2 | func | func | func
echo ${x}
func | func2 | func | func
echo ${x}
func | func | func2 | func
echo ${x}
func | func | func | func2
echo ${x}
echo enabling lastpipe ...
shopt -s lastpipe
func | func | func | func
echo ${x}
func2 | func | func | func
echo ${x}
func | func2 | func | func
echo ${x}
func | func | func2 | func
echo ${x}
func | func | func | func2
echo ${x}
}
##################################################
if [ ${#} -eq 0 ]
then
true
else
exit 1 # wrong args
fi
##################################################
test-pipelines-lastpipe
##################################################
## generated by create-stub2.sh v0.1.2
## on Sun, 21 Jul 2019 21:28:54 +0900
## see <https://github.com/temptemp3/sh2>
##################################################