Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-15-2010, 06:06 AM   #1
Senior Member
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Ubuntu, Debian, OS X
Posts: 1,300

Rep: Reputation: 102Reputation: 102
Question Shell Programming - BASH, KSH, ZSH

Dear All,

I have been scripting (or programming) in Bash shell for around 2+ years now.

I have heard that ksh and zsh are better shells than bash.

Are there any differences on the scripting side too, I mean is it easier to write a script in ksh or zsh rather than bash ?

Is there any benifit to code in ksh or zsh instead of bash.
Old 06-15-2010, 07:29 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,945
Blog Entries: 14

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
"better" is a term of opinion. I'm sure there are those who would passionately say "bash is the be all and end all" while others would say the same about zsh and ksh. My experience has been that most people that express strong opinions in favor of one thing over another when they are basically very similar is that the one they are "for" is the one they started with.

For most purposes ksh and bash can do the same job but that bash has more options. (There was a post on this once where someone noted something he could do in ksh easier than bash but I forget what it was.) Both beat the hell out of the original Bourne shell (sh) but in some systems like HP-UX sh is actually the Posix shell which is much like ksh/bash.

I worked for years in UNIX on ksh and initially resisted the move to bash on Linux but that was merely because of my preference for vi style history access - once I realized I could get that in bash with "set -o vi" I quit have a preference. If I'm on UNIX I use ksh (or Posix shell). If I'm on Linux I use bash.

The correct answer is to use the right tool for the job. There are situations where using ksh/bash/zsh isn't right - you need to use Perl.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Shell Programming CheeSen Programming 5 09-07-2008 01:36 AM
LXer: Basic I/O Redirection Differences In Sh/Ksh, Bash and Zsh On Linux And Unix LXer Syndicated Linux News 0 07-04-2008 04:51 AM
processing a ksh shell in bash environment ntoughe Programming 9 09-12-2005 05:09 AM
shell confusion..what is diff between bash, ksh, csh, tcsh..?? servnov Linux - Newbie 7 11-18-2004 08:28 PM
bash shell programming vivek_kumbhar Linux - General 4 04-12-2004 07:13 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:06 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration