Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Books or primers on shell scripting?

Books or primers on shell scripting?
Thread Tools
slugslugslug
Mac Elite
Join Date: Jan 2002
Location: Durham, NC
Status: Offline
Reply With Quote
Mar 16, 2008, 11:07 PM
 
I think I'm going to find some use for shell scripts later this year, so I want to start learning to write them. I don't think I'll have much trouble learning, but am not sure where to start. If anyone can recommend a good reference book or online resource, I'd appreciate it.

I'm one of those people who likes to use physical books for learning computery/programming topics, but I don't mind supplementing them with digital sources, so recommendations of both kinds are welcome.

Thanks.
     
mduell
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Mar 17, 2008, 10:10 PM
 
Which shell are you going to use? O'Reilly Media | Classic Shell Scripting is a decent book.
     
slugslugslug  (op)
Mac Elite
Join Date: Jan 2002
Location: Durham, NC
Status: Offline
Reply With Quote
Mar 18, 2008, 01:21 PM
 
I don't actually know just yet. I'm going to grad school in the fall, and I've heard that there's shell scripting that comes in handy for the kind of data analysis I might be doing. I didn't ask what shell folks use, though I imagine it'll be up to me.

I don't have a preference of yet, and I'd ask for recommendations, but I realize that it's one of those topics that can get religious. Are the scripting differences huge between the shells?
     
parallax
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 19, 2008, 11:48 AM
 
slugslugslug,

Shell scripts can be very useful. Many people write bash scripts regardless of what shell they use.

However, I strongly encourage you to learn a language like Python instead, which make things just as easy as shell scripts and offers you a better language with less quirks that can be scaled up.

Python scripts can be invoked just like a shell script and almost every modern system has Python already installed on it.

Also if you're doing data analysis, hands down Python wins over traditional shell scripting languages. :-)
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
slugslugslug  (op)
Mac Elite
Join Date: Jan 2002
Location: Durham, NC
Status: Offline
Reply With Quote
Mar 20, 2008, 11:05 AM
 
Thanks parallax. I'm actually already working through Learning Python. It seems like a lot of folks like it, and the latest version of SPSS has some Python APIs. So it seemed like a good time to at least get a handle on that. I just figured I'd pick up on shell scripting as well.

I may be working on some fMRI experiments, and from what I understand folks use shell scripts to invoke command-line data analysis tools for batch processing. I imagine this'll also be doable via Python (or pretty much any language that lets you run shell commands), but if I come across other folks' examples written as shell scripts, I want to be able to read them. So the tip about bash is useful.

Maybe I'll get O'Reilly's bash book while they've still got the buy-2-get-1-free sale on their website.
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 08:53 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,