LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

Rep: Reputation: 107Reputation: 107
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
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
"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.
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:45 PM.

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