Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!ucbcad!ucbvax!decvax!decwrl!pyramid!uccba!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon Allbery) Newsgroups: comp.unix.wizards Subject: Re: #! magic number Message-ID: <2720@ncoast.UUCP> Date: Fri, 26-Jun-87 18:14:36 EDT Article-I.D.: ncoast.2720 Posted: Fri Jun 26 18:14:36 1987 Date-Received: Sun, 28-Jun-87 00:45:37 EDT References: > <2211@bunker.UUCP> <1097@mtune.ATT.COM> <21681@sun.uucp> <7180@mimsy.UUCP> <1877@vdsvax.steinmetz.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 37 As quoted from <1877@vdsvax.steinmetz.UUCP> by barnett@vdsvax.steinmetz.UUCP (Bruce G Barnett): +--------------- | In article <7180@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: | Good example. But I cannot figure out how ELSE to use this feature | with awk. How can I create a t.awk that contains an awk script, | and make it executable? | | That is, in file t.awk, I have | | #!/bin/awk -f t.awk | | No matter what I try, I get the "bailing out near line 1" error. +--------------- That isn't quite valid. Firstly, some systems (not yours, apparently) require a space between the #! and the command name. Second, you should not include the program name; the kernel (or bexec if you got it) adds it automatically. Both also package everything after the command name in the #! sequence as a SINGLE argument. As a result, awk is seeing the command: /bin/awk '-f t.awk' t.awk which means "for all lines in t.awk which for which the condition "-f t.awk" is true, print the lines." Unfortunately, "-f t.awk" is not a valid condition; it's a syntax error. Remove the "t.awk" from the top line of your script and you will be all set. ++Brandon -- ---- Moderator for comp.sources.misc and comp.binaries.ibm.pc ---- Brandon S. Allbery !cbosgd!ncoast!allbery 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)