Subject: bin/1444: /bin/sh: "return" in dotted scripts
To: netbsd problem report <gnats-bugs@NetBSD.ORG>
From: Ju\"rgen Fluk <>
List: netbsd-bugs
Date: 09/07/1995 16:21:49
>Number:         1444
>Category:       bin
>Synopsis:       /bin/sh: "return" in dotted script
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep  7 17:50:02 1995
>Originator:     Ju"rgen Fluk
	marco GmbH, 85221 Dachau, Germany
>Release:        95/08/26
System: NetBSD robin 1.0A NetBSD 1.0A (ROBIN) #2: Fri Sep 1 12:18:58 MSZ 1995 root@robin:/usr/src/sys/arch/i386/compile/ROBIN i386

	bash (1.12.1) and ksh (86/03/06) allow use of "return"
	in dotted scripts to leave the script. SunOS 4.1.2 /bin/sh
	complains "cannot return when not in function". NetBSD /bin/sh
	simply ignores this "return".
	cat <<EOT >xxx
		echo hello
	chmod +x xxx
	. xxx
--		in real life: Ju"rgen Fluk
marco GmbH, 85221 Dachau	tel: +49 8131 516142