From owner-freebsd-questions@FreeBSD.ORG Sun Sep 9 13:18:01 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 CBDE516A417 for ; Sun, 9 Sep 2007 13:18:01 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 3ECD613C45E for ; Sun, 9 Sep 2007 13:18:00 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (dialup228.ach.sch.gr [81.186.70.228]) (authenticated bits=128) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id l89DHRIg003923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 9 Sep 2007 16:17:36 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.1/8.14.1) with ESMTP id l89DHOOf001907; Sun, 9 Sep 2007 16:17:25 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.1/8.14.1/Submit) id l89DHLb4001906; Sun, 9 Sep 2007 16:17:21 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 9 Sep 2007 16:17:21 +0300 From: Giorgos Keramidas To: Grant Peel Message-ID: <20070909131721.GA1859@kobe.laptop> References: <000801c7f274$6fae71e0$6501a8c0@GRANT> <20070909020657.GA4912@kobe.laptop> <46E367F7.6060705@u.washington.edu> <20070909081927.GB98684@thought.org> <006901c7f2e1$0067bb30$6501a8c0@GRANT> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006901c7f2e1$0067bb30$6501a8c0@GRANT> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.874, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.53, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Gary Kline , Garrett Cooper , 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 13:18:01 -0000 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). - Giorgos