From owner-freebsd-stable@FreeBSD.ORG Mon Jul 20 19:19:33 2009 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DCD106564A for ; Mon, 20 Jul 2009 19:19:33 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-fx0-f215.google.com (mail-fx0-f215.google.com [209.85.220.215]) by mx1.freebsd.org (Postfix) with ESMTP id 422258FC16 for ; Mon, 20 Jul 2009 19:19:32 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: by fxm11 with SMTP id 11so36726fxm.43 for ; Mon, 20 Jul 2009 12:19:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=k9IC/huxpWeGqC7MjMtLmWebmwagsWM8OWpSVUht8pQ=; b=CQi2K2FooykyWdqvbQMrGaK5j1PzAqV8R53mR7omz+dRHJ7nS6qnouJSlrH8ii8B7M mRw4/k5ZltV0vXRqECbiLhsLaSAGJXPN/cXJ3Y5OjBy18OiiEyRfm6iIEXjG+70So2Pn MxXhFVfVGBisgN7zjf4qWhX7DwK/EmnpOLYgs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=IUDsPaZ53PH7a0GBEZIuLvwE8y0WvYupvG0Z5U6TfNxtnPhOiPJaKUNO/cWwXkDLkb QRqGQyXYyoFi86wLx2n7KKWCv/eM9jnfDdUsZgQLvma7kn7ftgfnhw0ZRwTbVHr3UA4t gSV9L5w29bRSBKBtunDx/X9MVnIKPx273HjLY= MIME-Version: 1.0 Received: by 10.223.119.198 with SMTP id a6mr1535768far.42.1248117572140; Mon, 20 Jul 2009 12:19:32 -0700 (PDT) In-Reply-To: <4A64C1A6.3080607@FreeBSD.org> References: <4ad871310907191717g1ed90be7y92250f2addc38d43@mail.gmail.com> <4A64C1A6.3080607@FreeBSD.org> Date: Mon, 20 Jul 2009 15:19:32 -0400 Message-ID: <4ad871310907201219x42ea0f2ave0c288170ed56a96@mail.gmail.com> From: Glen Barber To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: stable@freebsd.org Subject: Re: Shell execution ( [was] Re: Value of $? lost in the beginning of a function.) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jul 2009 19:19:33 -0000 On Mon, Jul 20, 2009 at 3:12 PM, Doug Barton wrote: > Glen Barber wrote: >> Possibly off-topic... > > It's very off topic for -stable. If you want to follow up on this, > please do so in -hackers. > >> I meant to say in the last line: "'#!/bin/sh' would override the 'zsh' shell." >> >> Can someone enlighten me if I am wrong about this? > > It's trivial to create an example to test it yourself, don't ask when > you can do. :) > > #!/bin/foo > echo yes > > $ ./foo > bash: ./foo: /bin/foo: bad interpreter: No such file or directory > > $ sh foo > yes > > $ bash foo > yes > > > Now it's your turn. :) > Hi, Doug. The test I was going to run was: --------------------- #!/bin/sh echo $SHELL --------------------- which I would execute from $PATH and from 'sh/csh/zsh foo.sh', but I haven't had much time to play around with it. I plan on having time later today after ${JOB}. -- Glen Barber