Linux Expert The Manual

Robert P. J. Day rpjday at crashcourse.ca
Sun Dec 12 06:59:10 UTC 2010


On Sun, 12 Dec 2010, Doug wrote:

> I agree with the above completely. One thing I think needs to be
> addressed, however, is that a lot of what is written in various
> places assumes too much of the reader.  My specific point:  I am
> trying to learn bash programming, at least the basics of same.

  personally, i wouldn't try to learn *bash* programming as much as
i'd want to learn POSIX-compliant shell programming, so that the
scripts you write are maximally portable.  yes, bash has lots of
wickedly cool, extended features, and it's worth knowing what they are
in order to read other peoples' bash scripts, but if you want your
scripts to truly run everywhere, try to stick with POSIX programming.

  the recommended book: http://oreilly.com/catalog/9780596005955/.
and not to sound unhumble but that book exists because, a few years
ago, i mentioned to one of the senior editors at ORA that what they
really needed was a book on precisely that topic.  so, yes, that is my
name in the acknowledgements. :-)  if you can afford it, get a copy.

  besides, these days, on most linux distros, if you invoke a script
using "/bin/sh", you should be guaranteed to have that script run in
pure POSIX mode.

> (I don't expect to become an expert at it, but I need a better
> handle on it for school.) Much of what's available starts with a
> humongous script, and then tries to dissect some small part of it,
> leaving the rest in limbo.

  in my experience, learning how to write simple scripts doesn't take
long.  writing really advanced scripts requires a solid understanding
of the most common linux commands that do file operations, and text
processing and so on.  if you want to be a good script writer, you
need to learn how to use sort, and grep, and awk, and ... you get the
idea.  and that ORA book has a considerable section devoted to that.

  ok, i've rambled enough.

rday

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the ubuntu-users mailing list