[olug] Newbie Bash Scripting Tutorial

Christopher Cashell topher-olug at zyp.org
Wed Sep 16 04:54:23 UTC 2009


On Tue, Sep 15, 2009 at 8:43 PM, Amy Mason <amason80 at gmail.com> wrote:
> I've been lurking around here for several months, since I used to come to
> meetings before moving to Lincoln, but I was wondering if anyone has a good
> idea where I can find a decent tutorial for bash scripting, as well as a
> tutorial for filters on the command line. (Things like "sort" "comm" "tr",
> piping and redirection, etc...  I'm in a Linux class now, and honestly not
> getting as much out of my professor's lectures as I would hope, and really
> could use the help.

There's been a couple of good URLs posted, including one from The
Linux Documentation Project, and The Advanced Bash Scripting guide
(ABS).  Both of those are well worth reading.

However, I think what helped me the most wasn't the bash specific
stuff or the scripting logic, so much as the O'Reilly book "Linux in a
Nutshell".  The first part of the book covers general Linux command
line usage, but the meat of the book is a fairly comprehensive
reference of command line commands, along with good descriptions,
examples, etc.  I'd suggest picking up a copy of that book and, as
boring as it sounds, read the entire command reference.  You don't
need to memorize it or study it, but at least skim through every
single command in the reference and take a look at it's description.

Then, when you are writing a shell script and you need to do foo, you
might remember that a command already exists to do foo, and you might
even recall the name of the command.  Often in shell scripting, the
key really is just knowing that a command already exists that'll do
most of the work for you.

Don't skip the chapters in awk and sed, either.  They may not be as
fashionable as Perl and company, but I can't count how many times I've
pulled them out to accomplish something faster and easier than anyone
thought possible.

> Amy

-- 
Christopher



More information about the OLUG mailing list