[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] Shell Scripting
- Subject: Re: [cobalt-users] Shell Scripting
- From: "H.P. Stroebel" <hpstr@xxxxxxxxxxxxx>
- Date: Mon Jan 29 14:42:02 2001
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
"Rodolfo J. Paiz (E-mail)" schrieb:
> I'm about to start learning to script on Linux. (Yes, I've ignored this
> facet of my education in the past.) However, I have no clue as to
> whether perl or shell-scripts (or something else) is the best first
> choice for general-purpose scripting.
>
> What would you recommend? My purpose is, I imagine, the most pedestrian
> one: to automate server tasks my way, just as Jeff did with his
> ntpupdate script recently. I tend to prefer tcsh for my shell, but am
> acutely aware that many/most people stick to bash (so much so that my
> root identities on all servers still use bash just in case...)
my 2 cents (= 0.05 euro ;-) :
for server administration, you will have to know some shell (bash)
scripting, as the startup scripts and many scripts for system
maintainance are written in bash.
on the other hand, perl is much more sophisticated, and all you can do
using a shell script, you can do in perl as well.
a shell script does not do much more than starting other processes, and
perl can do that, too (in several different ways) if the desired
function isn`t yet implemented or available as a module, or too
complicated.
perl is more complex and thus a bit more difficult to learn, as by
writing a shell script, you do not much more than sticking together the
usual commands that you use every day on the command prompt itself; that
means, you know most of them already.
IMHO, if you are used to the command prompt, learning shell scripting is
no problem. you just have to learn to use the "glue" for the single
commands (loops, decisions, pipes etc.). on the other hand, with only
basic perl knowledge, you will be able to understand what most shell
scripts are doing, and you will be able to implement them in perl
yourself, so they will be usable even where tcsh is not installed, thus
more portable (several scripts, most CGI scripts for example, will run
even under windoze without changes)
so, i recommend perl (personally, i don`t write shell scripts any more).
a VERY good book for beginners is "learning perl" by randal l. schwartz
(o`reilly). it will be sufficient for most administration tasks to be
done on a unix system.
(after having finished the book, a good task to acquire some experience
: just for fun, try to write your own simple mail transport agent. not
on your production raq, of course... ;-)
--
H. P. Stroebel, Germany
CGI-FAQ for Raq-Newbies :
http://users.iol.it/hpstr/
Apollo 13 - Commander : "Houston, we have a problem"
Win2000 - Administrator : "Redmond, we have 64000 problems"