From owner-freebsd-questions Fri Jan 25 18:45:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f175.law11.hotmail.com [64.4.17.175]) by hub.freebsd.org (Postfix) with ESMTP id 9664137B402 for ; Fri, 25 Jan 2002 18:45:10 -0800 (PST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 25 Jan 2002 18:45:10 -0800 Received: from 68.6.89.248 by lw11fd.law11.hotmail.msn.com with HTTP; Sat, 26 Jan 2002 02:45:10 GMT X-Originating-IP: [68.6.89.248] From: "Charles Burns" To: questions@freebsd.org Subject: Re: shells confusion Date: Fri, 25 Jan 2002 19:45:10 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 26 Jan 2002 02:45:10.0422 (UTC) FILETIME=[78CAA360:01C1A613] 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 >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. By far "BASh" (Bourne Again Shell) is the most popular Unix shell, especially in Linux. BASh is compatible with Sh as well, so learning Sh scripting will work in BASh. Sh is also by far the most common shell to script for, as pretty much every Unix OS has a shell that will run Sh scripts. I would probably recommend learning Sh/BASh scripting. BASh has some features that Sh generally does not, but you can do most anything without them. Sh is also a very powerful scripting language, for example I have a full x86 assembler on my system written in pure Sh script. As to why Sh is default, I have heard reasons like, "It uses less memory", "It uses less disk space", "most scripts are written for Sh specifically", etc. As far as compelling reasons why the ancient, horrible shell is still default, I have heard none. Charles Burns _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message