Linux Expert The Manual
MR ZenWiz
mrzenwiz at gmail.com
Sun Dec 12 20:22:04 UTC 2010
On Sat, Dec 11, 2010 at 10:59 PM, Robert P. J. Day
<rpjday at crashcourse.ca> wrote:
> 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.
:
> 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.
>
That and a fairly solid understanding of how to write algorithms using
a script-based language (i.e., sh).
I learned most of what I know in shell programming from the man page,
which, really, is all you *need* to know to write even moderately
sophisticated shell scripts. There are a few gotchas behind those
scenes, but if you really read and understand the man page, that's
enough for most shell scripting.
As Robert says, it isn't so much the shell scripting that's the trick,
it's using other commands that frequently are required, and
understanding those is just as important.
IOW, +1.
:-)
More information about the ubuntu-users
mailing list