From owner-freebsd-stable@FreeBSD.ORG Mon Jul 20 18:25:10 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 041C2106564A for ; Mon, 20 Jul 2009 18:25:10 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-bw0-f208.google.com (mail-bw0-f208.google.com [209.85.218.208]) by mx1.freebsd.org (Postfix) with ESMTP id 8D31E8FC12 for ; Mon, 20 Jul 2009 18:25:08 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: by bwz4 with SMTP id 4so1945448bwz.43 for ; Mon, 20 Jul 2009 11:25:07 -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=ZM0Bp+ETOk4wyiJF2zNCGWBEWq9ExhMXKit/pQ5WcuI=; b=Lbvu3rJONXkQTImi2G6G/gak9DXnz1Im2VJm5CpNm9EtjWLvjUcy/1wpo7HkqW/n4I UWayWrxii1PmE9imyWAgLIpqLq0FlaCh1tfemkWvDBi5xrlwmAHct4DqCUSjEtCSlNlm aDoxKuM+hvZzRwCCU9TarYEHgnVlrKxGRUlLc= 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=gbrpKjcMXC3s9I6E1dFcrbTIiqwxj4C9S7+zeVR1u8kaf1mxqUJGvHNA89Hg6Axavk M9BnrhUomX+9jkebhg1ZrL/QHy/bCGzpxnwZLqgyilWV8FK5dALXdPNKBsij9WeTRaPJ FelJeVqsG7bBiiUZOyAEGJ1/UfCkEHy3MLC5g= MIME-Version: 1.0 Received: by 10.223.108.15 with SMTP id d15mr1536489fap.105.1248114307204; Mon, 20 Jul 2009 11:25:07 -0700 (PDT) In-Reply-To: <44k523fdc4.fsf@be-well.ilk.org> References: <4ad871310907191717g1ed90be7y92250f2addc38d43@mail.gmail.com> <44tz17k46h.fsf@lowell-desk.lan> <4ad871310907200702q6d13a44bqaeb2242d65866b16@mail.gmail.com> <44k523fdc4.fsf@be-well.ilk.org> Date: Mon, 20 Jul 2009 14:25:07 -0400 Message-ID: <4ad871310907201125u42789ff9h57c74c26b0538c18@mail.gmail.com> From: Glen Barber To: Lowell Gilbert Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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 18:25:10 -0000 On Mon, Jul 20, 2009 at 1:56 PM, Lowell Gilbert wrote: > Glen Barber writes: >>> The shell specified in the "#!" first line is only consulted if you run >>> it as "./foo.sh". =A0Otherwise, it's input to the shell that you starte= d, >>> and the line is only a comment. >>> >> >> I suppose that makes sense, but what if the script location is in the >> user's $PATH? > > That would be the same as "./foo.sh". > The distinction is between whether the file is treated as an executable > or as input to a script. =A0You might find the manual page for execve(2) > useful for more detail on how the former case is handled. > > > Aha! Yes, I will have a look. Thanks for the point in the right direction= . --=20 Glen Barber