I'm a UNIX/Linux shell scripting newbie. I've seen a few Zaurus User Group How-To pages on some script examples and I think I unterstood 85% of what I saw...- How many different kinds of shell script (.sh... are there other extensions too?) languages are supported under Linux in the Zaurus?
- What are the differences between them?
- Why use one over the other?
- Where can I find "Shell Scripting For Dummies" kind of resource/page/site?
Thanks!
(1) There are no shell script extensions -- anything that is in place is just to be nice.
(2) There are none, since extensions aren't used.
(3) Oh, you mean shells!
(4) best is internet -- there's one ... shell programming gems, let me see what I can find.
http://www.spy.org/programming/sh/as-txtBasically, the command interface for unix... is called a shell -- but really this "shell" is just
a way to launch commands. Shells can be brain-dead simple, or they can get overly-complex.
Traditionally, unix has had "sh" for root and system accounts and scripts, but you will see
that linux is probably using bash and I think freebsd is using tcsh (for root's shell) -- but
most scripting is done using /bin/sh -- because it's pretty standard. Of course, /usr/bin/perl
is also pretty standard -- although I remember when it wasn't, etc.
If you program in plane-jane "sh" (no ksh extensions, etc) ... you might be able to get some
cross platform compatibility -- but it isn't guaranteed.
sh is decent for programming, but is severely lacking in some areas such as math and
advanced data types (ie: arrays?) ... csh is more user friendly than sh for interactive use,
but it's really a mess for programming. I don't think anyone really programs in csh,
although I did write a BBS once in tcsh.
I have used tcsh for my shell since the late 80s....but I've been meaning to switch over to
zsh. I'm starting to put zsh into use on different machines now, but zsh may not be
installed "standard" on many machines -- the same is probably true os tcsh.
There are many other "shells" out there -- and you could even make your own. Just
about any program that has a command interpreter in it could probably be used as a
shell (ie: I know someone who had emacs as their login shell -- and I had perl as my
login shell for a while... recently I was looking into Ch as my login shell).
As far as programming, the net is probably the best resource to find examples of
programs. There are few gotchas with sh programming compared to other languages
(ie: setting var values a while loop doesn't work -- sometimes -- because a child
can't affect the parent [without a specific arrangement to do so]).
Feel free to ask questions here if you are stuck with something regarding shell programming.
Scott