From owner-freebsd-current@FreeBSD.ORG Fri Oct 1 12:45:37 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E3A6216A4CE for ; Fri, 1 Oct 2004 12:45:37 +0000 (GMT) Received: from bache.ece.cmu.edu (BACHE.ECE.CMU.EDU [128.2.129.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB1D43D53 for ; Fri, 1 Oct 2004 12:45:37 +0000 (GMT) (envelope-from allbery@ece.cmu.edu) Received: from [10.9.204.1] (dsl093-061-215.pit1.dsl.speakeasy.net [66.93.61.215]) by bache.ece.cmu.edu (Postfix) with ESMTP id 4D0AF74; Fri, 1 Oct 2004 08:45:35 -0400 (EDT) From: "Brandon S. Allbery KF8NH" To: =?iso-8859-2?Q?S=B3awek_=AFak?= In-Reply-To: <86y8irx5ga.fsf@thirst.unx.era.pl> References: <861xgm5ltz.fsf@thirst.unx.era.pl> <86k6ud2t6t.fsf@thirst.unx.era.pl><415AB9BF.1070003@gamersimpact.com> <86is9wx8qp.fsf@thirst.unx.era.pl> <20040930124810.GA17792@nexus.dglawrence.com> <86y8irx5ga.fsf@thirst.unx.era.pl> Content-Type: text/plain; charset=UTF-8 Message-Id: <1096634733.48170.8.camel@rushlight.kf8nh.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Fri, 01 Oct 2004 08:45:34 -0400 Content-Transfer-Encoding: 8bit cc: Ryan Sommers cc: Ceri Davies cc: "David G. Lawrence" cc: freebsd-current@freebsd.org Subject: Re: Bug in #! processing X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2004 12:45:38 -0000 On Thu, 2004-09-30 at 09:16, Sławek Żak wrote: > "David G. Lawrence" writes: > > The #! is required to be in the first two bytes of the file, so there > > can't be any spaces before it. > > Oh. Thus in following script: > > thirst(1950)% cat tst.sh > #!/bin/no-such-file > ps -lp $$ exec*() fails in that case, and shells assume it's a sh script. csh (used to?) assume a csh script if the first character is #, or you can use "alias shell" to tell it which shell to assume. This is how scripts worked before #!. -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [WAY too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon univ. KF8NH