From owner-freebsd-questions@FreeBSD.ORG Sun Sep 9 20:31:18 2007 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 E24CE16A419 for ; Sun, 9 Sep 2007 20:31:18 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 53B9713C47E for ; Sun, 9 Sep 2007 20:31:15 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.8/8.13.1) with ESMTP id l89KV284003951; Sun, 9 Sep 2007 13:31:05 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id l89KUxrf003950; Sun, 9 Sep 2007 13:30:59 -0700 (PDT) (envelope-from kline) Date: Sun, 9 Sep 2007 13:30:57 -0700 From: Gary Kline To: Mel Message-ID: <20070909203057.GD3569@thought.org> References: <000801c7f274$6fae71e0$6501a8c0@GRANT> <20070909131721.GA1859@kobe.laptop> <20070909193540.GA3569@thought.org> <200709092212.15837.fbsd.questions@rachie.is-a-geek.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200709092212.15837.fbsd.questions@rachie.is-a-geek.net> User-Agent: Mutt/1.4.2.2i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 21 of service to the Unix community. Cc: freebsd-questions@freebsd.org Subject: Re: csh if..then delhema. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Sep 2007 20:31:19 -0000 On Sun, Sep 09, 2007 at 10:12:15PM +0200, Mel wrote: > On Sunday 09 September 2007 21:35:40 Gary Kline wrote: > > On Sun, Sep 09, 2007 at 04:17:21PM +0300, Giorgos Keramidas wrote: > > > On 2007-09-09 08:57, Grant Peel wrote: > > > > Thanks for the input gentlemen, > > > > Interesting to that the question was posted by G(rant) and then > > > > answered by G(ary), G(arrett) and G(iorgos)! (what are the odds!). > > > > > > Haha :) > > > > > > > Anywho, I am busily converting the script to perl as per the > > > > suggestions. I use tcsh rarely, had I of known the quirks I woul shave > > > > done it in perl from the beguining. > > > > > > > > As for Garrett's case method, it didnt work. Created a "case: Too many > > > > arguments." error. Perhaps because it itself is nested in a 'foreach' > > > > statement. > > > > > > `foreach' is a csh construct. If you copied the case/esac code posted > > > by Garrett, then it wouldn't work. The syntax used by Garrett was for > > > the Bourne shell (hence the /bin/sh reference above case). > > > > > > If you are going to convert everything to /bin/sh, you may as well > > > convert it to Perl unless there is some very good reason to use only > > > the pretty minimal data-structures supported by the Bourne shell > > > (i.e. because you want to run the script in environments where Perl > > > may be too much to require). > > > > Do any of you gents know if there is a converter that turns > > Bo[u]rne (:-)) shell into perl? Years ago there was > > commericalware (i Think) that took /bin/sh to C. Maybe Ii'm > > mis-remembering. I've googled aroud and find zip, so maybe I > > was in some kind of coma-zone. > > > > At any rate, for simple unix scripts, /bin/sh (aka "a-shell", ash) > > or ksh or zsh is the way to go. Simple == a few lines. > > For anything grittier, perl wins any time. > > Perl looses when /usr isn't mounted. That's the primary argument against using > anything other then /bin/sh (including bash). All the rest is preference. > This iswhy I used to have zsh in /bin; "used to"--I've gotten complacent. But with the recent panic in '04 or '05, and now that I'm moving to Garrett's beefed up Dell, it is time to get real again. gary, (Sundays are for the joys-of-hacking!) kline > -- > Mel > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org