Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!husc6!cmcl2!rutgers!clyde!cbosgd!cwruecmp!hal!ncoast!allbery
From: allbery@ncoast.UUCP (Brandon Allbery)
Newsgroups: comp.unix.wizards
Subject: Re: #! magic number
Message-ID: <2793@ncoast.UUCP>
Date: Sun, 5-Jul-87 17:45:33 EDT
Article-I.D.: ncoast.2793
Posted: Sun Jul  5 17:45:33 1987
Date-Received: Tue, 7-Jul-87 00:46:39 EDT
References:  > <2211@bunker.UUCP>
Reply-To: allbery@ncoast.UUCP (Brandon Allbery)
Followup-To: comp.unix.wizards
Organization: Cleveland Public Access UN*X, Cleveland, Oh
Lines: 33

As quoted from <4145@teddy.UUCP> by jpn@teddy.UUCP (John P. Nelson):
+---------------
| >>No matter what I try, I get the "bailing out near line 1" error.
| > ^^^^^^^^^^^^^^^^^^^^
| >csh >cat t.awk
| >#!/bin/awk -f 
| 
| I think the problem is relatively simple.  I used "SUN" cut+paste to grab
| the script in question, and I had the same problem.  I then noted that the
| #!/bin/awk line had a BLANK at the end of the line.  I have to assume that
| when the kernel sees the blank, it inserts a "null" argument.
+---------------

Nope.  awk checks for -f with strcmp, but the kernel is bundling the space
into the (single) argument it produces, so the command line ends up being:

/bin/awk "-f " filename

which tells awk to run the program "-f " (which is a syntax error) on the
input file "filename".  Zap the space, the strcmp in awk succeeds, and all
is well.

++Brandon
-- 
       ---- Moderator for comp.sources.misc and comp.binaries.ibm.pc ----
Brandon S. Allbery	!cbosgd!ncoast!allbery (NOW!!!!)
aXcess Company		{ames,mit-eddie,harvard,talcott}!necntc!ncoast!allbery
6615 Center St. #A1-105	{well,sun,pyramid,ihnp4}!hoptoad!ncoast!allbery
Mentor, OH 44060-4101	necntc!ncoast!allbery@harvard.HARVARD.EDU (Internet)
+01 216 974 9210	ncoast!allbery@CWRU.EDU (CSnet -- if you dare)
NCOAST ADMIN GROUP	Brandon Allbery on 157/504 (Fidonet/Matrix/whatever)
* ncoast -- Public Access UN*X -- (216) 781-6201, 24 hrs., 300/1200/2400 baud *
 * ncoast is proud to be carrying alt.all -- contact me for more information *