From owner-freebsd-questions@FreeBSD.ORG Sun Jun 6 02:30:06 2010 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 C2045106564A for ; Sun, 6 Jun 2010 02:30:06 +0000 (UTC) (envelope-from corky1951@comcast.net) Received: from qmta12.westchester.pa.mail.comcast.net (qmta12.westchester.pa.mail.comcast.net [76.96.59.227]) by mx1.freebsd.org (Postfix) with ESMTP id 67EA38FC1C for ; Sun, 6 Jun 2010 02:30:06 +0000 (UTC) Received: from omta20.westchester.pa.mail.comcast.net ([76.96.62.71]) by qmta12.westchester.pa.mail.comcast.net with comcast id SS6i1e0051YDfWL5CSW6e2; Sun, 06 Jun 2010 02:30:06 +0000 Received: from comcast.net ([98.203.142.76]) by omta20.westchester.pa.mail.comcast.net with comcast id SSW41e00C1f6R9u3gSW5yZ; Sun, 06 Jun 2010 02:30:06 +0000 Received: by comcast.net (sSMTP sendmail emulation); Sat, 05 Jun 2010 19:30:03 -0700 Date: Sat, 5 Jun 2010 19:30:03 -0700 From: Charlie Kester To: freebsd-questions@freebsd.org Message-ID: <20100606023003.GA69297@comcast.net> Mail-Followup-To: freebsd-questions@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Mailer: Mutt 1.5.20 X-Composer: Vim 7.2 User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: which is the basic differences between the shells? 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, 06 Jun 2010 02:30:06 -0000 On Sat 05 Jun 2010 at 16:24:36 PDT Alejandro Imass wrote: >On Sat, Jun 5, 2010 at 6:35 PM, Giorgos Tsiapaliokas wrote: >> hello, >> i am coming from the linux world where i was using the bash shell but i >> found out that there are also much more. >> can u tell me the basic differences between them?(pros and cons) >> > >Too broad a topic I suspect fo u to get an answer here. In FBSD the >base system is completely separate from the applications, that is >really great because for example your system upgrades are >independendent of applications / ports. The base shell is in the base >system so don't replace the shell for the root user but rather start >bash from your root account if you wish. This will make sense when >your system breaks in an upgrade for example. > >For everything else you can safely use bash and choose bash for your >normal users. I use bash all the time even for root, but in the latter >case I start it manually. Definitely too broad a topic for a mailing list. Probably the best way to approach it is to look first at the Bourne shelli (sh), which probably has the smallest and simplest set of features. The C shell (csh) is, as the name suggests, more like the C programming language. It was developed at UC Berkeley, and thus has always had a close association with BSD. One of the major innovations introduced by the C shell is *history*. tcsh is an enhanced but completely compatible version of csh. The Korn shell (ksh) combined many features from the C shell with the functionality of the Bourne shell. Among the many new features introduced by the Korn shell are pattern-based variable substitution, e.g. ${varname%%pattern}. Bash picks up where the Korn shell leaves off, and adds even more features. More features usually means increased size and sometimes slower execution. In fact, if you look at the manpage for bash, the first sentence in the last section ("BUGS") is a frank admission that "It's too big and too slow." It's also too GPL-encumbered for many BSD folk. You can get many of the same features in a lighterweight package, with a friendlier license, by going with one of the Korn shells instead. I've been using shells/mksh from ports after having it recommended to me in the forums, and I've been very satisfied with it.