
How do I create a shell script on a Macintosh?
A reader writes:
I've started to go through your shell script book Wicked Cool Shell Scripts but there is still something I'm unclear on. I'm showing my ignorance here, but how exactly do you save a shell script so you can use it later?" If not, you can use an application like BBEdit, save the file as text-only with or without line breaks, then open up the Terminal application and type in the name of the script, as in sh myscript.sh (assuming you saved the file as 'myscript.sh'). The final step is for you to actually make the script executable, which you can do by using the chmod command, as in: chmod +x myscript.sh. Once you've done that - particularly if you have the script in one of the directories in your PATH - you can execute the script by simply typing its name at the command line.
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
Mac OS X Help
, Shell Script Programming
(Article 3746)
Tagged: Previous: The Future of Online Advertising Next: How do I get SSH & X Windows working? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader.
Rather amazingly, there are no comments on this article yet.
I have a lot to say, but ...
I do have a comment, now that you mention it!
|
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|