1 #!/bin/bash
2 #
3 # Tests for pipelines.
4
5 ### Brace group in pipeline
6 { echo one; echo two; } | tac
7 # stdout-json: "two\none\n"
8
9 ### For loop in pipeline
10 for w in one two; do
11 echo $w
12 done | tac
13 # stdout-json: "two\none\n"
14
15 ### Exit code is last status
16 expr $0 : '.*/osh$' && exit 99 # Disabled because of spec-runner.sh issue
17 echo a | egrep '[0-9]+'
18 # status: 1
19
20 ### |&
21 stdout_stderr.py |& cat
22 # stdout-json: "STDERR\nSTDOUT\n"
23 # N-I dash/mksh stdout-json: ""