• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Integrating Unix scripting in Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrating Unix scripting in Cocoa app


  • Subject: Re: Integrating Unix scripting in Cocoa app
  • From: Kevin Kuehl <email@hidden>
  • Date: Tue, 7 Aug 2007 05:01:57 -0700 (PDT)

--- Ron Fleckner <email@hidden> wrote:

> At the moment, I'm assuming
> that the shebang line is the FIRST line of the
> script which makes it
> easy to find.

The '#!" not only has to be on the first line, the two
characters also have to be the first two in the file.
They are a special case for UNIX magic numbers.
Please see: http://en.wikipedia.org/wiki/Sha-bang for
more information.

> My question: Do people ever write shell scripts
> without a shebang
> line or where the shebang line is NOT the first line
> of the script?

The only time I ever leave it out of shell scripts is
when I write code fragments that are not to be
executed on their own.  For example, if a script is
meant to be sourced into another one, I'll leave it
out as a reminder not to try to execute the script.

If '#!' are not the first two characters in a file,
there's not much you can do.  If you can determine
it's a text file, you could probably try sending it to
/bin/sh and see what happens.  I don't think making
the demand that the script either starts with a '#!'
or is a /bin/sh script is too unreasonable.  There is
a lot of history to support this choice.

Kevin Kuehl
email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Integrating Unix scripting in Cocoa app
      • From: Ron Fleckner <email@hidden>
References: 
 >Integrating Unix scripting in Cocoa app (From: Ron Fleckner <email@hidden>)

  • Prev by Date: Re: Integrating Unix scripting in Cocoa app
  • Next by Date: Re: Integrating Unix scripting in Cocoa app
  • Previous by thread: Re: Integrating Unix scripting in Cocoa app
  • Next by thread: Re: Integrating Unix scripting in Cocoa app
  • Index(es):
    • Date
    • Thread