PDA

View Full Version : Learning to write shell scripts.



Reddoug
October 25th, 2010, 02:43 AM
Hi All

I am trying to learn how to write shell scripts. Taking a class for it but the book we are using does not follow what the instructor says. I do not know anyone outside of class that does it. Looking for a good book to use. Any recommendations? We are using vi editor and .sh shell.

Thanks, Doug

rbishop
October 25th, 2010, 03:16 AM
Not a book but the worlds greatest teacher.....GOOGLE IT!!!!


That is how I have learned 95% of what I know....given I am still trying to learn myself. But it is an extremely great resource.

Are you looking to do anything specific, or just learning in general?

Reddoug
October 25th, 2010, 04:00 AM
Hi
Just wanting to learn. I am stumped on an assignment and have tried Googling it with out any luck. I am trying to use grep and have short program tell how many directories there are. I spent several hours on it today.

Thanks, Doug

wkhasintha
October 25th, 2010, 04:13 AM
This is a good e-book .. highly recommend it bro

http://sourceforge.net/projects/linuxcommand/files/TLCL/09.12/TLCL-09.12.pdf/download

geirha
October 25th, 2010, 08:48 AM
90% of the "tutorials" and "guides" out there on shell scripting are junk, so google is not recommended for learning scripting.

I recommend you stick with http://mywiki.wooledge.org/BashGuide and http://mywiki.wooledge.org/BashFAQ and the other pages at that wiki. It's mainly meant for bash, but most of the pages take care to mention what is bash/ksh-specific and what will work in POSIX shells and the bourne shell.

What do you mean by ".sh shell" though? Does it need to be bourne compatible, or just POSIX?

mo.reina
October 25th, 2010, 09:47 AM
http://tldp.org

bash guide for beginner's was the one i used, though i've heard great things about advanced bash scripting guide.

geirha
October 25th, 2010, 09:03 PM
http://tldp.org

bash guide for beginner's was the one i used, though i've heard great things about advanced bash scripting guide.

The bash guides at tldp.org are terrible guides for learning scripting. They don't teach good practice, and parts of them are outdated and/or just plain wrong.

mo.reina
October 25th, 2010, 10:14 PM
The bash guides at tldp.org are terrible guides for learning scripting. They don't teach good practice, and parts of them are outdated and/or just plain wrong.

really? which parts?

i read the bash guide for beginners cover to cover, everything seemed to work... i had to google a bit to look up some stuff that was mentioned but not explained but besides that i didn't have any problems.

Reddoug
October 25th, 2010, 10:51 PM
Hi and thanks for all the information. I will check all out.

Thanks, Doug