~emersion/mrsh

ref: ec97ac337f6321197c3809759b75eeda97e1bdc9 mrsh/test/return.sh -rw-r--r-- 305 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
#!/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