From owner-freebsd-questions@FreeBSD.ORG Wed Jul 27 14:40:42 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58AEC106566C for ; Wed, 27 Jul 2011 14:40:42 +0000 (UTC) (envelope-from doug@fledge.watson.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by mx1.freebsd.org (Postfix) with ESMTP id 1CDE68FC1A for ; Wed, 27 Jul 2011 14:40:42 +0000 (UTC) Received: from fledge.watson.org (localhost.watson.org [127.0.0.1]) by fledge.watson.org (8.14.4/8.14.4) with ESMTP id p6REefro095041; Wed, 27 Jul 2011 10:40:41 -0400 (EDT) (envelope-from doug@fledge.watson.org) Received: from localhost (doug@localhost) by fledge.watson.org (8.14.4/8.14.4/Submit) with ESMTP id p6REeeFt095035; Wed, 27 Jul 2011 10:40:40 -0400 (EDT) (envelope-from doug@fledge.watson.org) Date: Wed, 27 Jul 2011 10:40:40 -0400 (EDT) From: doug To: Mark Moellering In-Reply-To: <4E2F1C0F.4040108@msen.com> Message-ID: References: <4E2F1C0F.4040108@msen.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (fledge.watson.org [127.0.0.1]); Wed, 27 Jul 2011 10:40:41 -0400 (EDT) Cc: FreeBSD Subject: Re: Book recommendations (slightly OT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: doug@safeport.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 14:40:42 -0000 On Tue, 26 Jul 2011, Mark Moellering wrote: > I want to automate some tasks, creating directories, file editing, etc. I > was going to pick up a book on shell scripting but wanted to ask the list if; > A) I am barking up the wrong tree and should use something else. > B) If I am headed in the right direction, what is the best book / resource to > use? > > Thanks in advance > > Mark Moellering I second Matthew's sh recommendation. Doing admin stuff is much much easier if you learn the basics of regular expressions, awk, sed and xargs. Also find. The daily jobs and the scripts in /etc have lots of coding examples. Of course mergermaster and portmaster are the king and queen of sh scripts. Google will yield thousands of simple examples of all the above and more. If you are doing lexical stuff perl is hard to beat.