Re: Bug in #! processing

From: Brandon S. Allbery KF8NH <allbery_at_ece.cmu.edu>
Date: Fri, 01 Oct 2004 08:45:34 -0400
On Thu, 2004-09-30 at 09:16, Sławek Żak wrote:
> "David G. Lawrence" <dg_at_dglawrence.com> 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<zaks>(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_at_kf8nh.com
system administrator      [WAY too many hats]        allbery_at_ece.cmu.edu
electrical and computer engineering, carnegie mellon univ.         KF8NH
Received on Fri Oct 01 2004 - 10:45:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:15 UTC