From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 17 11:21:34 2004 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6B56E16A4CE for ; Sat, 17 Apr 2004 11:21:34 -0700 (PDT) Received: from lakermmtao05.cox.net (lakermmtao05.cox.net [68.230.240.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFA4843D49 for ; Sat, 17 Apr 2004 11:21:33 -0700 (PDT) (envelope-from vince@hightek.org) Received: from quark.hightek.org ([68.12.75.33]) by lakermmtao05.cox.net (InterMail vM.6.01.03.02 201-2131-111-104-20040324) with ESMTP id <20040417182132.ISTC4944.lakermmtao05.cox.net@quark.hightek.org> for ; Sat, 17 Apr 2004 14:21:32 -0400 Received: by quark.hightek.org (Postfix, from userid 501) id 3D78712408; Sat, 17 Apr 2004 13:22:04 -0500 (CDT) Date: Sat, 17 Apr 2004 13:22:04 -0500 From: Vincent Stemen To: freebsd-bugs@FreeBSD.ORG Message-ID: <20040417182204.GA26559@quark.hightek.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: /bin/sh bug X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2004 18:21:34 -0000 Another sh bug I think. If you dot in a file from a script, $1 in the child script inherits it's value from the parent and the arguments do not get passed. This is on FreeBSD-5.1-RELEASE on the i386 platform. The following examples compare the behavior to bash and zsh. Zsh has the most appropriate bahavior as it also properly sets $0. $ cat test1 echo "$0: \$1 = [$1]" . ./test2 test2arg $ cat test2 echo "$0: \$1 = [$1]" $ sh ./test1 foo ./test1: $1 = [foo] ./test1: $1 = [foo] $ bash ./test1 foo ./test1: $1 = [foo] ./test1: $1 = [test2arg] $ zsh ./test1 foo ./test1: $1 = [foo] ./test2: $1 = [test2arg] -- Vincent Stemen Avoid the VeriSign/Network Solutions domain registration trap! http://www.InetAddresses.net