LinuxQuestions.org
Visit Jeremy's Blog.
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, 07:06 AM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,270

Rep: Reputation: 99
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, 08:29 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

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


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 02: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 05:51 AM
processing a ksh shell in bash environment ntoughe Programming 9 09-12-2005 06:09 AM
shell confusion..what is diff between bash, ksh, csh, tcsh..?? servnov Linux - Newbie 7 11-18-2004 09:28 PM
bash shell programming vivek_kumbhar Linux - General 4 04-12-2004 08:13 AM


All times are GMT -5. The time now is 08:37 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration