Which Shell is best.......? (341 Views)
Reply
Occasional Advisor
R.SRIDHAR
Posts: 17
Registered: ‎03-16-2008
Message 1 of 11 (341 Views)

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

Hi
Which shell is best shell (sh, csh, tcsh, ksh)
Which is recommended to SAP and why?
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 2 of 11 (341 Views)

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
dirk dierickx
Posts: 958
Registered: ‎12-20-1999
Message 3 of 11 (341 Views)

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
Ralph Grothe
Posts: 2,631
Registered: ‎04-09-2000
Message 4 of 11 (341 Views)

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
Bob_Vance
Posts: 602
Registered: ‎06-13-2000
Message 5 of 11 (341 Views)

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
Duncan Edmonstone
Posts: 5,684
Registered: ‎08-05-2000
Message 6 of 11 (341 Views)

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
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 7 of 11 (341 Views)

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#M...

Honored Contributor
Viktor Balogh
Posts: 1,007
Registered: ‎03-15-2009
Message 8 of 11 (341 Views)

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
Michael Steele_2
Posts: 4,934
Registered: ‎08-14-2002
Message 9 of 11 (341 Views)

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
R.SRIDHAR
Posts: 17
Registered: ‎03-16-2008
Message 10 of 11 (341 Views)

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

Thanks to all.
Acclaimed Contributor
James R. Ferguson
Posts: 21,184
Registered: ‎07-06-2000
Message 11 of 11 (338 Views)

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

[ Edited ]

HI:

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


...JRF...

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.