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
# Pipes: simple, multi-stage, exit codes
[[]]
= "simple_pipe"
= 'echo "hello world" | tr a-z A-Z'
= """
HELLO WORLD
"""
= ""
= 0
[[]]
= "multi_stage_pipe"
= 'echo -e "c\na\nb" | sort | head -1'
= """
a
"""
= ""
= 0
[[]]
= "pipe_preserves_lines"
= 'printf "a\nb\nc\n" | wc -l'
= """
3
"""
= ""
= 0
[[]]
= "pipe_exit_code_is_last_command"
= 'false | true; echo $?'
= """
0
"""
= ""
= 0
[[]]
= "pipe_grep_filter"
= 'printf "apple\nbanana\ncherry\n" | grep an'
= """
banana
"""
= ""
= 0