From owner-freebsd-questions Sat Jan 26 8:11:11 2002 Delivered-To: freebsd-questions@freebsd.org Received: from avocet.prod.itd.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by hub.freebsd.org (Postfix) with ESMTP id 1DE8137B41B for ; Sat, 26 Jan 2002 08:11:06 -0800 (PST) Received: from dialup-63.208.65.171.dial1.chicago1.level3.net ([63.208.65.171] helo=pegasus) by avocet.prod.itd.earthlink.net with smtp (Exim 3.33 #1) id 16UVQ0-00063D-00; Sat, 26 Jan 2002 08:11:05 -0800 Message-ID: <004301c1a684$0de9bb00$ab41d03f@pegasus> From: "Bob Giesen" To: "Bernie" , "freebsd-questions" References: <20020126020430.P175-100000@BLAST> Subject: Re: shells confusion Date: Sat, 26 Jan 2002 10:11:02 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG For scripting, the most logical choice to learn first is the Bourne shell (/bin/sh on most systems). As you've noted, the vast majority of existing scripts that are supplied with systems are written in Bourne, so you will have little trouble translating what you learn to all those examples that you have available to you. Also, should you desire to modify any of those scripts, you will be less likely to break them through syntax errors. (Notice the "#!/bin/sh" at the tops of those scripts? The leading "#!" tells the invoking shell to run the script in a subshell of the following command (/bin/sh, in this case). So, if you were to insert something from ksh (Korn Shell), e.g., that /bin/sh doesn't understand, the script will fail.) Once you're comfortable with sh, you'll want to consider looking at the other shells -- especially if you work at the command line a lot and/or do a lot of scripting. Most other popular UNIX command shells (ksh, bash, zsh) are mostly supersets of the Bourne shell, so you will find it very easy to take advantage of their extended features after you've learned Bourne. It is a natural progression. However, should you learn one of those whiz-bang shells, first, you may find dealing with Bourne-shell scripts a bit more frustrating when you find that you have to take into account its limitations. ----- Original Message ----- From: "Bernie" To: Sent: Friday, January 25, 2002 6:18 PM Subject: shells confusion > > hi, > > i'm planning to learn shell programming but i'm not sure > on which one to choose... > > i've been reading in the 'FreeBSD unleashed' that people > wanting to do shell programming should stay away from > c-shell as it's realy good for interactive, but very bad > for scripts. is this true? > > also, looking into the scripts in /etc, i see a line on the > top saying 'bin/sh'. so are they all written in 'sh' and > not csh ? if so, why freebsd comes with csh as default? > > also, why single user mode proposes /bin/sh as default? > is there any particular reason for it? > > i'm a bit confused on which shell to pick from programming. > also i've been thinking of perl, but for the moment i think > i've got to learn at least how to do basic shell programming, > not only to write programs, but also to understand scrips that > come with the system. > > but the question is 'which shell' ... > > any advice on this matter will be appreciated. > > > Regards > > --Bernie > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message