From owner-freebsd-questions@FreeBSD.ORG Wed Oct 25 19:15:31 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 02E8B16A403 for ; Wed, 25 Oct 2006 19:15:31 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout1.cac.washington.edu (mxout1.cac.washington.edu [140.142.32.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9114843D5F for ; Wed, 25 Oct 2006 19:15:24 +0000 (GMT) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.33.7]) by mxout1.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id k9PJFMvh029376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 25 Oct 2006 12:15:22 -0700 X-Auth-Received: from [192.168.0.101] (dsl254-013-145.sea1.dsl.speakeasy.net [216.254.13.145]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id k9PJFGfn024190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Oct 2006 12:15:21 -0700 Message-ID: <453FB7BB.5020209@u.washington.edu> Date: Wed, 25 Oct 2006 12:15:07 -0700 From: Garrett Cooper User-Agent: Thunderbird 1.5.0.7 (X11/20060929) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <226ae0c60610250940h43c1bea8o77326728f15ed058@mail.gmail.com> In-Reply-To: <226ae0c60610250940h43c1bea8o77326728f15ed058@mail.gmail.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-PMX-Version: 5.2.0.266434, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2006.10.25.115933 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __LINES_OF_YELLING 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Subject: Re: Bug with tcsh? : if evaluating true instead of false 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: Wed, 25 Oct 2006 19:15:31 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 David Robillard wrote: >> Ok, so I tried to make a simple script to add users so I wouldn't have >> to type in groups/pw over and over again... the problem is that it's not >> behaving like it should =o. > > [ ...8<... Removed a bunch of lines ...8<... ] > > IMHO, if you need to script something, use /bin/sh. It's the standard > shell interpreter on all flavors of UNIX and Linux (except maybe MacOS > X). All of the rc scripts are written with it. So why bother with > another shell? > > Here's an interesting read on the topic: > http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/ > BTW, Tom Christiansen who wrote this is co-author of "Programming > Perl" from O'Reilly. > > So, Garret, if you need help with this, I have a /bin/sh version of > the script you're trying to do. Just drop me a line and I'll send it > to you. > > Just my two cents :) > > David I appreciate the help thanks! I usually do stuff in either bash or csh, depending on the level of difficulty, but try to use tcsh for all FreeBSD scripts on my system since tcsh is included as a part of the base system. Plus, I do like tcsh better in some ways because the syntax is similar to C/C++ and Java, but as you saw if I get in a programming funk with either of the 3 beforementioned languages, it's fun remembering language semantics sometimes :). I'd appreciate the script though, definitely, as any resource I have to learn all Unix script languages properly will only help in my becoming a better Unix admin as well as script more common tasks to help make my life a bit easier. Thanks! - -Garrett -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFP7e66CkrZkzMC68RAhsUAJ93jj0Qx1aFcVPLe0WT9xGnSiaEIQCdFiq1 D3AaQo5y5wv9Pcn8G4WbYQM= =LcA7 -----END PGP SIGNATURE-----