1828745 Members
3460 Online
109985 Solutions
New Discussion

Re: Unix Shell??

 
MO_4
Frequent Advisor

Unix Shell??

I'm new to Unix. How do I find out what Unix shell I'm using? Bourne. C, Korn, Posix???

Thanks,

MO.
18 REPLIES 18
Patrick Wallek
Honored Contributor

Re: Unix Shell??

Do an 'env' and grep for sh.

# env | grep sh
MO_4
Frequent Advisor

Re: Unix Shell??

uxkomni # env | grep sh
MANPATH=/usr/share/man/%L:/usr/share/man:/usr/contrib/man/%L:/usr/contrib/man:/usr/local/m
an/%L:/usr/local/man:/opt/upgrade/share/man/%L:/opt/upgrade/share/man:/usr/dt/share/man:/o
pt/pd/share/man/%L:/opt/pd/share/man:/opt/hparray/share/man:/opt/ignite/share/man/%L:/opt/
ignite/share/man:/opt/resmon/share/man:/opt/perf/man/%L:/opt/perf/man:/opt/OV/man/itose/%L
:/opt/OV/man/itose:/opt/omni/lib/man:/opt/openmail/share/man:/opt/asu/lanman/man:/opt/hpnp
l//man
HISTFILE=/.sh_history
SHELL=/sbin/sh
ENV=//.shrc


SHELL?????
PIYUSH D. PATEL
Honored Contributor

Re: Unix Shell??

Hi,

You can open the /etc/password file and check.
See against the user name.
Or

env | grep SHELL

/bin/ksh - Korne shell
/bin/sh - Bourne Shell
/bin/csh - C shell

Piyush


MO_4
Frequent Advisor

Re: Unix Shell??

/bin/sh I guess I'm running Bourne shell.

/bin/ksh - Korne shell
/bin/sh - Bourne Shell
/bin/csh - C shell

They should have put a "b" in front of the "sh".

Thanks Piyush/Patrick.

Martin Johnson
Honored Contributor

Re: Unix Shell??

/usr/bin/sh = posix shell on HPUX.


HTH
Marty
Mike Hassell
Respected Contributor

Re: Unix Shell??

MO,

Yes, SHELL is your current shell, hence you are running the default Bourne shell.

If you want to change your default shell to Korn, you would issue:

chsh /bin/ksh

Refer to the man pages if you want to learn more about how Bourne shell works:

man sh

Hope that helps.

-Mike
The network is the computer, yeah I stole it from Sun, so what?
Patrick Wallek
Honored Contributor

Re: Unix Shell??

Nope, the 'sh' (/bin/sh, /usr/bin/sh, /sbin/sh) are HP's POSIX shell, NOT bourne.
James R. Ferguson
Acclaimed Contributor

Re: Unix Shell??

Hi:

No, you are running the Posix (standard) shell.

'/bin/sh' is a symbolic link to /usr/bin/sh. This is the Posix shell and is most desirable.

The old Bourne shell is really:

/usr/old/bin/sh

...and you don't want that!

Regards!

...JRF...
MO_4
Frequent Advisor

Re: Unix Shell??

Hold on guys, I'm getting confused.

/usr/bin/sh means POSIX or BOURNE?

PIYUSH D. PATEL
Honored Contributor

Re: Unix Shell??

Hi,

Its the Posix shell.../usr/bin/sh.
Sorry guys...I confused all of you.

Piyush
Rodney Hills
Honored Contributor

Re: Unix Shell??

At one point in time /usr/bin/sh was bourne. And at least as far as 11.x is concerned it is now posix.

-- Rod Hills
There be dragons...
James R. Ferguson
Acclaimed Contributor

Re: Unix Shell??

HI (again) Mo:

HP-UX offers the POSIX shell (statically linked in /sbin/sh, and dynamically linked in /usr/bin/sh). This is the preferred shell. In fact, /sbin/sh *must* be used for the root account. Failure to do so will lead to an unbootable system.

The Posix shell is a superset of Korn.

The old Bourne shell is useless.

As for the C-shell, this is a bug-laden poor-excuse for a shell. Stay away from it.

Regards!

...JRF...
MO_4
Frequent Advisor

Re: Unix Shell??

GOT IT. I'm running POSIX.

Thank you all!!! and my hat off to HP for this wonderful forum. Honestly, I did not expect an answer so quickly. I'm hooked. My goal in the next few months is to learn all I can about Unix OS. Hopefully in a few months I'll be helping you guys out.

Thanks once again,

MO.
Martin Johnson
Honored Contributor

Re: Unix Shell??

do a "man sh" for a overview of the shells supported on HPUX.

HTH
Marty
Sridhar Rao
Advisor

Re: Unix Shell??

U can even use the following command to check in which shell u r working.

echo $SHELL.

Not only shell using the above command (echo $XXX. XXX is any environment variable) u can get the value of any environment variable.

Regards,
Sridhar.
The Network is the Computer
David Blair_2
New Member

Re: Unix Shell??

What's wrong with doing 'ps' to find your shell ?
Gregory Fruth
Esteemed Contributor

Re: Unix Shell??

"echo $SHELL" reports your login shell. It's not
necessarily the same as the shell you're currently
in:

unix% echo $SHELL
/usr/bin/tcsh
unix% ksh
unix% echo $SHELL
/usr/bin/tcsh