views:

315

answers:

8

I have been using 'bash' since the time I have been using Unix- Linux/Solaris. Now, I am interested to know what do shells like 'ksh','zsh' offer better? What do 'geeks' use?

+4  A: 

I'm partial to zsh (it's like a blend of ksh and bash). The guide has a nice overview of its features. This page has a nice chart showing the availability of different features in different shells.

CTT
'zle' (http://zsh.sunsite.dk/Guide/zshguide04.html#l75) seems cool.
Amit
A: 

I had one rigged up to provide per-session shell history.

The unique thing here was each window had its own shell history. Quite convenient.

Joshua
Is this through bash?
Rizwan Kassim
I did this with ksh myself. I don't do it that way now, but I think you can accomplish this with zsh, and probably with bash.
Craig S
On some systems I got it by symlinkinging .history (or is it .sh_history) to /dev/null. On others I had to compile a custom shell.
Joshua
+1  A: 

I use ksh93 by preference. This means that the basics of ksh are available on pretty much any system I find myself on, so my interactive experience and 98% of my complex profile stay the same.

Darron
+1 If you commonly work on a single (or some other small number) of *nix OS flavors, then any shell is OK. If you work on "some" or "a lot" of different OS flavors, then ksh should quickly jump to the top of your list of preferred shells. I have never found a *nix that did not include ksh as a default shell.
semiuseless
+4  A: 
  • bash: In my experience, most people use bash, partly because it is the standard shell in most Linux systems.

  • ksh: Many Solaris systems use ksh instead, but that seems to be loosing popularity to bash.

  • csh: Csh used to be more popular, but was generally superseded by tcsh. tcsh is not bad for those who are very comfortable with c-like syntax.

  • zsh: I have not used zsh, but it seems to be very feature rich.

Personally, I prefer bash, because it is installed on almost every unix-compatible OS, it is very versatile, and is a good compromise between a simple command-line tool and a scripting language.

Colin
+1  A: 

bash is a bit slow, but like many FSF programs, it tries to incorporate all known features. I use ksh93, which has largely converged with bash. The main advantage of ksh is that it's got a nice interface for extending the shell with C code. It's also a little easier to customize, e.g., to make tab key do whatever you want, in context. Disadvantage is that command completion is not built in; you have to program it.

Avoid csh and its derivatives :-)

Norman Ramsey
+1  A: 

In my experience, there are very few goodies in standard Unix shells (where that means, to me, csh, sh, ksh) that are not also present in at least an equivalent form in bash. Consequently, as long as you are comfortable that bash will be on all your machines, you may as well use it to get the maximum functionality.

OTOH, if you want to deal with portability, you will probably use ksh, which hews pretty close to the POSIX standard - with some extensions (bash is also fairly close to the POSIX standard, but with rather more extensions).

I really like the POSIX $(cmd) notation in place of the classic back-ticks

`cmd`

(That was not fun in Markdown!). One major reason for liking it is that it is much, much easier to nest the calls:

gcclib=$(dirname $(dirname $(which gcc)))/lib

Getting that right on one line with back-ticks is silly enough that you would not attempt to make it into a one-liner. That's in ksh and bash; it is not in the classic Bourne shell (/bin/sh, but be aware that /bin/sh on some machines is not the classic Bourne shell but bash in disguise), nor in the C shell.

Jonathan Leffler
+2  A: 

Bash is best to know for the most broad compatibility, you can sit at basically any Unix and it will be there.

Zsh is one of the most modern shells, probably. There's all kinds of crazy fun stuff you can do with it

prestomation
+1  A: 

If you're using bash and you're happy with it, no need to change right away. It's a good shell. Knowing the history of it tells you something about it too: Bourne Again SHell. It was a good attempt to make a better shell than the C-Shell and its derivatives (like tcsh), allowing you to use /bin/sh syntax for scripting (or for interactive use), but adding some of the nicer features of csh (like history and so on).

The Korn shell and Bash have a lot in common, in concept anyway. Like /bin/sh, the Korn shell came from AT&T originally, and wasn't open sourced until relatively recently. It has a good history mechanism, and does file locking on history state files so that if they're mounted on network file servers, multiple copies of the shell will properly write to the history file without clobbering each other. It also supports /bin/sh syntax, and incorporates some of the good things about /bin/csh. There's a lot to ksh, and it's generally a pretty good shell, if you can find it. I used to use it on Solaris, especially back when I was working at Sun. I didn't want to install anything that didn't come with the OS, since I installed a new OS several times a week, so this was a good choice.

Now I use either Bash or zsh. I prefer zsh because of its rich set of features for command completion and for writing shell functions in general (for my interactive shells -- when programming scripts, I stick to pretty standard Bourne shell stuff).

As others have said, it's best to avoid any version of the C-shell, except for those shells that give you some features of /bin/csh but aren't derived from /bin/csh code.

Craig S