From owner-freebsd-questions@FreeBSD.ORG Tue Feb 10 10:03:03 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 75D9D16A4CE for ; Tue, 10 Feb 2004 10:03:03 -0800 (PST) Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ACD943D1D for ; Tue, 10 Feb 2004 10:03:03 -0800 (PST) (envelope-from jcm@FreeBSD-uk.eu.org) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by serenity.mcc.ac.uk with esmtp (Exim 4.20) id 1AqcDm-000Nax-6i; Tue, 10 Feb 2004 18:02:54 +0000 Received: from dogma.freebsd-uk.eu.org (localhost [127.0.0.1]) i1AI2rVi054494; Tue, 10 Feb 2004 18:02:53 GMT (envelope-from jcm@dogma.freebsd-uk.eu.org) Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.12.10/8.12.6/Submit) id i1AI2r8e054492; Tue, 10 Feb 2004 18:02:53 GMT Date: Tue, 10 Feb 2004 18:02:52 +0000 From: Jonathon McKitrick To: Jerry McAllister Message-ID: <20040210180252.GC48583@dogma.freebsd-uk.eu.org> References: <20040210154416.GB33394@dogma.freebsd-uk.eu.org> <200402101648.i1AGmnX07002@clunix.cl.msu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200402101648.i1AGmnX07002@clunix.cl.msu.edu> User-Agent: Mutt/1.4i X-Spam-Score: -4.9 (----) X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *1AqcDm-000Nax-6i*LsdSCtBa2GQ* cc: freebsd-questions@freebsd.org Subject: Re: Choosing between sh and perl for system scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 18:03:03 -0000 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. : 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. jm -- My other computer is your Windows box.