~emersion/mrsh

ref: ec97ac337f6321197c3809759b75eeda97e1bdc9 mrsh/test/pipeline.sh -rw-r--r-- 642 bytes
ec97ac33Simon Ser shell/task/word: implement trim prefix/suffix operator for simple patterns 2 years 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