ksh vs bash

Hi,

I've a general question regarding shell. I 've seen that every where i worked in production environment people are using ksh .. but i like to use .. bash .. is there any particular reason why hardcore sysadmins use ksh ?

My answer: because ksh is (1) installed by default on more systems, and (2) is generally available no matter what boot mode (ie, single-user), and (3) older admins don't know/care about 3rd party (ie, GNU) tools. Also, (4) because of (1), you can write shell scripts that are more "portable".

In terms of capabilities, I doubt there are many differences between bash and ksh. But there are subtle differences that can and will break shell scripts.

ksh supports co-processes. It also compiles scripts and runs the compiled code and this makes it very fast. But if you like bash go ahead and use it... it's not a terrible shell.

Thanx for the info ..

What's a co-process?

See Automate FTP / Scripting FTP Transfers for examples.

UNIX shell differences and how to change your shell (Monthly Posting)

i prefer to use ksh for scripts but bash for my every day use.

Here are some of the reasons I prefer ksh (and especially ksh93) compared to bash:

ksh supports FPATH to load functions on demand
ksh put the command on the left side of a pipe in a subshell while bash put the one at the right side: a poor choice in my opinion.
vi mode doesn't always behave the way I expect under bash
co-processes (already mentioned)
direct networking support with ksh93 (/dev/tcp/host/port)
multi-line commands recovered from the history are unchanged by ksh but are "single-lined" by bash. This annoys me a lot as I often use multi-lines commands that I edit with vi. Bash join all lines and make the result much more difficult to read/edit.