Subject: bin/1444: /bin/sh: "return" in dotted scripts
To: netbsd problem report <gnats-bugs@NetBSD.ORG>
From: Ju\"rgen Fluk <louis@dachau.marco.de>
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
>Last-Modified:
>Originator:     Ju"rgen Fluk
>Organization:
	marco GmbH, 85221 Dachau, Germany
>Release:        95/08/26
>Environment:
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

>Description:
	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".
>How-To-Repeat:
	cat <<EOT >xxx
		return
		echo hello
	EOT
	chmod +x xxx
	. xxx
--
louis@dachau.marco.de		in real life: Ju"rgen Fluk
marco GmbH, 85221 Dachau	tel: +49 8131 516142
>Fix:
>Audit-Trail:
>Unformatted: