Re: Integrating Unix scripting in Cocoa app
Re: Integrating Unix scripting in Cocoa app
- Subject: Re: Integrating Unix scripting in Cocoa app
- From: Alastair Houghton <email@hidden>
- Date: Tue, 7 Aug 2007 11:58:44 +0100
On 7 Aug 2007, at 11:38, Ron Fleckner wrote:
My app has a Scripts menu from which the user can run Ruby, Python,
Perl and AppleScripts. I want to be able to support shell and
other script types and to do so, I need to get the shebang line
from the script file and pass that to NSTask. At the moment, I'm
assuming that the shebang line is the FIRST line of the script
which makes it easy to find.
My question: Do people ever write shell scripts without a shebang line
Yes, *however* you can't make them directly executable. i.e. to run
them you must explicitly ask the shell to run them. Most shell
scripts, therefore, do have a shell bang.
The shell bang has to be on the first line of the script in order for
the shell to spot it, so looking there is just fine.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
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