NetBSD Problem Report #1444

From gnats  Thu Sep  7 17:45:47 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id RAA01961 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 7 Sep 1995 17:45:46 -0400
Message-Id: <m0sqhpt-00003lC@ra.dachau.marco.de>
Date: Thu, 7 Sep 95 16:21:49 MET
From: "Ju\"rgen Fluk" <louis@dachau.marco.de>
To: gnats-bugs@netbsd.org (netbsd problem report)
Subject: /bin/sh: "return" in dotted scripts

>Number:         1444
>Category:       bin
>Synopsis:       /bin/sh: "return" in dotted script
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 07 17:50:02 +0000 1995
>Closed-Date:    Sat Feb 10 18:31:14 +0000 1996
>Last-Modified:  Sat Feb 10 18:32:35 +0000 1996
>Originator:     Ju"rgen Fluk
>Release:        95/08/26
>Organization:
	marco GmbH, 85221 Dachau, Germany
>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:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: christos 
State-Changed-When: Sat Feb 10 13:31:14 EST 1996 
State-Changed-Why:  
Fixed a long time ago 
>Unformatted:
 X-send-pr-version: 3.2

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.