~emersion/mrsh

ref: 07e65a3a88e03c6d9e6f1f6ac4a1cfa9a74a9b09 mrsh/test/pipeline.sh -rw-r--r-- 633 bytes
07e65a3aSimon Ser parser/arithm: fix && and || 1 year, 10 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 "Pipeline with 1 command"
echo "a b c d"

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

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

echo "Pipeline with bang"
! false
echo $?

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

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

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