Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

Which Shell is best.......?

Occasional Advisor

Which Shell is best.......?

Hi
Which shell is best shell (sh, csh, tcsh, ksh)
Which is recommended to SAP and why?
10 REPLIES
Acclaimed Contributor Acclaimed Contributor

Re: Which Shell is best.......?

HI:

Whatever you use (and in HP-UX, the Posix shell found in '/sbin/sh' or '/usr/bin/sh' is the standard shell most like the Korn shell) do NOT use 'csh'. A classic paper describes the reasons why not to:

http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

Regards!

...JRF...
Honored Contributor Honored Contributor

Re: Which Shell is best.......?

Oh boy, what a question. the best shell is the one you know the best and are the most comfortable with.

Keep in mind that most script you will find are either written in bourne or korn shell.
Honored Contributor Honored Contributor

Re: Which Shell is best.......?

Despite Tom Christiansen's (I reckon Tom would name Perl as his favorite shell ;-) "Csh considered harmful" that JFR referred to, for some obscure reason the sapadm accounts on all of our SAP app server HP-UX hosts were given a csh as login shell.
That unorthodox shell nexus, to put it mildly, which must have been committed by our SAP admins who installed and set up their SAP bloatware themselves, indeed already posed an unseen tripwire to me (the c-shell-wise uninitiated admin) who when asked to schedule a cronjob for sapadm was haunted back by mysterious redirection phenomena or was initially left puzzled with strange environment effects until he found out that csh uses the special setenv command and syntax with variables all lower case (sic!). Very strange environment indeed for the Bourne Shell Descendants accustomed admin.
Madness, thy name is system administration
Esteemed Contributor Esteemed Contributor

Re: Which Shell is best.......?

You should know that C-shell is called the

crap shell

for a reason.


HP's Posix shell is very good, although not totally portable to Linux bash shell (the HP shell has some more extended syntax and features).

bv
"The lyf so short, the craft so long to lerne." - Chaucer
Honored Contributor Honored Contributor

Re: Which Shell is best.......?

So there are 2 questions there:

Q1: Which is the best shell

A1: It's really down to personal preference, but most folks agreee that csh is _not_ the best shell. Personally I like to use sh (the POSIX shell, not the bourne shell on HP-UX), but ksh is probably slightly more portable between different UNIX flavours.

Q2: Which is recommended to SAP and why?

A2: Well just to confuse things, SAP recommend csh (see SAP Note 202227). You would have to ask SAP _why_ they do this. The note talks about some issues with different implementations of ksh on different platforms, but to be honest I've never seen any serious issues with using ksh or sh with SAP. Note that the SAP note talks about what login shell to use for SAP users - it _does not_ mean you actually have to write shell scripts in csh. You can still write a script in sh or ksh as long as you reference it in the first line of the script appropriately (with a #!/usr/bin/ksh or whatever)

HTH

Duncan

HTH

Duncan
Acclaimed Contributor Acclaimed Contributor

Re: Which Shell is best.......?

[ Edited ]

You want a shell that has a history/redo mechanism. And one that allows good scripting.

I was conned into thinking the scummy C shell was better than the borne shell. But when I found out ksh had vi editing for redo, I've never looked back at csh.

And that leads you to your other thread:
http://h30499.www3.hp.com/t5/Languages-and-Scripting/command-line-editing-in-CSH-shell/m-p/4783417#M30519

Honored Contributor Honored Contributor

Re: Which Shell is best.......?

here is a comparison table which might help you choose a proper shell:

http://viktorbalogh.net/blog/hp-ux/hp-ux_general/differences-between-shells

****
Unix operates with beer.
Honored Contributor Honored Contributor

Re: Which Shell is best.......?

Aix, hpux, linux and solaris all have there own native shells, Korn, bash, posix and bourne. Learn them all, or, use korn for korn is on all of them and the most sophisticated.

There will still be times when you have to know the native shell by O/S and you can't get around this.

Support Fatherhood - Stop Family Law
Occasional Advisor

Re: Which Shell is best.......?

Thanks to all.
Acclaimed Contributor Acclaimed Contributor

Re: Which Shell is best.......?

[ Edited ]

HI:

If you are happy with the answers you received, please read:


...JRF...