From owner-freebsd-questions@FreeBSD.ORG Sun Jun 6 11:19:32 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 66EC51065679 for ; Sun, 6 Jun 2010 11:19:32 +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 D2BA78FC14 for ; Sun, 6 Jun 2010 11:19:31 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-0.2, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_50 0.80) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: o56BJEM2032099 Received: from kobe.laptop (193.92.246.105.dsl.dyn.forthnet.gr [193.92.246.105]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.1) with ESMTP id o56BJEM2032099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 6 Jun 2010 14:19:25 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.4/8.14.4) with ESMTP id o56BJ91N021204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 6 Jun 2010 14:19:09 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.4/8.14.4/Submit) id o56BJ8Vl021201; Sun, 6 Jun 2010 14:19:08 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Giorgos Tsiapaliokas References: Date: Sun, 06 Jun 2010 14:19:08 +0300 In-Reply-To: (Giorgos Tsiapaliokas's message of "Sat, 5 Jun 2010 22:35:09 +0000") Message-ID: <87k4qc5ryr.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: freebsd-questions@freebsd.org 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 11:19:32 -0000 On Sat, 5 Jun 2010 22:35:09 +0000, 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) It isn't humanly possible to write *all* the differences of *all* the shells in a single email reply. But you can find a good table that compares various shells in Wikipedia: http://en.wikipedia.org/wiki/Comparison_of_command_shells In a FreeBSD context there are also a few more things to consider when comparing shells: * Is the shell part of the base system or a port/package? * Is the shell well maintained? * Does the shell depend on many other ports or none at all? * Does the shell support building static-only copies? This is useful if you want to upgrade the base system without breaking the login shell you are using every day. Having said that, here are a few personal notes from my own experience with shells on FreeBSD... The /bin/sh and /bin/csh shells are part of the base system, so they are rebuilt as part of the normal buildworld process. The big advantage of using a shell that is part of the base system is that it's always there. Any shell scripts or code you write that uses these shells will have a great chance of running on ANY FreeBSD system out there. That's where traditionalism stops and personal preference jumps in though... I don't like using csh(1) for a lot of things. It syntax makes me cringe, even though it's a mostly "ok" interactive shell. So I always install at least bash and mksh on my systems. There is no bash shell in the *base* system of FreeBSD. But there are many ports for command shells, and bash is part of these: # cd /usr/ports/shells 44bsd-csh dash jailkit pdksh tcshrc Makefile es ksh93 pear-PHP_Shell v7sh bash esh lshell psh viewglob bash-completion fd mksh rc vshnu bash-static fish nologinmsg rssh wapsh bash3 flash osh sash zoidberg bash3-static gscommander p5-Shell-Perl scponly zsh bashc heirloom-sh p5-Term-ShellUI shell-include ch ibsh pash tcsh_nls # You can always install bash with "pkg_add". The default package is not built as a static binary, but you can compile a static bash binary from its port: # cd /usr/ports/shells/bash # make WITH_STATIC_BASH=1 install clean The bash shell depends on two other ports: gettext and libiconv. These are not large ports, but it is often a good idea to have a shell around that only depends on libc. This is why I also install 'shells/mksh' on my systems. It's the ksh compatible shell of the MirOS BSD folks. It has a small foot-print, a ksh-compatible syntax, and it depends only on libc.so: keramida@kobe:/home/keramida$ ldd `which mksh` /usr/local/bin/mksh: libc.so.7 => /lib/libc.so.7 (0x280c9000)