~emersion/mrsh

ref: f1342b124da2cf87e57f70bd8f1a9c221bca47fe mrsh/test/return.sh -rw-r--r-- 305 bytes View raw
f1342b12Simon Ser shell/task/word: implement parameter minus operator 8 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
#!/bin/sh -e
func_a() {
	echo func a
	return
	echo func a post-return
}

func_b() {
	echo func b
	return 1
	echo func b post-return
}

func_c() {
	echo func c
	while :
	do
		echo func c loop
		return
		echo func c loop post-return
	done
	echo func c post loop
}

func_a

if func_b
then
	exit 1
fi

func_c