~sircmpwn/mrsh

ref: a2f07abd89fd7300a05c42860b856aea72be9687 mrsh/test/pipeline.sh -rw-r--r-- 671 bytes View raw
a2f07abdSimon Ser Move highlight example to new subdir, add a Meson option for it 7 months ago
                                                                                
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
#!/bin/sh

echo >&2 "Pipeline with 1 command"
echo "a b c d"

echo >&2 "Pipeline with 2 commands"
echo "a b c d" | sed s/b/B/

echo >&2 "Pipeline with 3 commands"
echo "a b c d" | sed s/b/B/ | sed s/c/C/

echo >&2 "Pipeline with bang"
! false
echo $?

# https://github.com/emersion/mrsh/issues/100
echo >&2 "Pipeline with subshell"
(echo "a b"; echo "c d") | sed s/c/C/

# https://github.com/emersion/mrsh/issues/96
echo >&2 "Pipeline with brace group"
#{ echo "a b"; echo "c d"; } | sed s/c/C/

# https://github.com/emersion/mrsh/issues/95
#echo >&2 "Pipeline with early close"
#(
#	i=0
#	while [ $i -lt 8096 ]
#	do
#		echo "Line $i"
#		i=$((i+1))
#	done
#) | head -n 1