Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2004 13:07:27 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        jcm@FreeBSD-uk.eu.org (Jonathon McKitrick)
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Choosing between sh and perl for system scripts
Message-ID:  <200402101807.i1AI7R407407@clunix.cl.msu.edu>
In-Reply-To: <20040210180252.GC48583@dogma.freebsd-uk.eu.org> from "Jonathon McKitrick" at Feb 10, 2004 06:02:52 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> On Tue, Feb 10, 2004 at 11:48:48AM -0500, Jerry McAllister wrote:
> : > 
> : > 
> : > Now that I have a desktop workstation and network, I'm trying to learn the
> : > true admin side of BSD, such as the periodic tasks, and how to automate
> : > things.  I see perl all over the system, and I know it's powerful and easy
> : > to use.  What might help me decide which tool would be best for the scripts
> : > I want to write?
> : 
> : Probably the two main things to consider are what type of processing
> : you will be doing and how much it will be used.
> : 
> : Perl is great for text processing - grabbing things out of text
> : streams, mashing it around, creating easily searched and manipulated 
> : tables of that sort of stuff.   It is not really so good at anything
> : that needs a lot of floating point number crunching.
> 
> One place I saw it used that piqued my interest was as an aid to maintaining
> source code.  The book 'The Pragmatic Programmer' talks about perl scripts
> being used to mark areas that need attention, extract comments, make reports
> on changes, and so on.

Well, since that would be a lot of mucking through text files, Perl
would probably be a good choice for it.

> : Perl is good for scripts that get used now and then.  But, it is
> : kind of big so if the script is likely to be used a lot - every
> : second or so, then you will want to use something leaner.  Probably
> : either sh or even write it in C.
> 
> For me on my home box, I will probably be using it to run backups, cvsup,
> build world, and so on.

Hmmm.   Could go either way on those.  Most of our backup stuff is
in either sh because it is not very complicated or C because it needs
to run SUID.

////jerry

> 
> jm
> -- 
> My other computer is your Windows box.
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402101807.i1AI7R407407>