Operating System - HP-UX
1823726 Members
3517 Online
109664 Solutions
New Discussion юеВ

What kind of Shell I'm using

 
Lalo_Weng
Advisor

What kind of Shell I'm using

Hi, All masters

I want to know what kind of shell I'm using after I login my system with prompt '#'. How can I do?

Thanks in advance
Keep finding is the way.
9 REPLIES 9
Michael Tully
Honored Contributor

Re: What kind of Shell I'm using

Hi,

There are two basic ways to find out.

# grep -i userid /etc/passwd (substitute your userid and where it states /usr/bin/ksh as the last part of the line)
or
# ps (your shell will show as 'sh' or 'ksh' as one of the active processes from the output)

HTH
-Michael
Anyone for a Mutiny ?
Emanuele Zanotti
New Member

Re: What kind of Shell I'm using

Hi,

you can type

echo $SHELL

at the prompt to determine what kind of shell you are currently using. You can use the 'chsh' command to modify it temporarily.
For permanent modification you have to modify the .profile file with the appropriate information concerning the shell type you'd like to use.

Regards


Emanuele
Magdi KAMAL
Respected Contributor

Re: What kind of Shell I'm using

Hi Lalo,

In /etc/passwd, there is one line per username. Columns, in each line, are field separator, the end field show you what kind of shell a giving user is using.

Sam->Accounts for Users and Groups ->Users

Hilight an antry -> Menu Actions -> Modify

See the "Star-Up Program" which mention the script a given user is using.

Don't forget to cancel the modification. It was just for showing the startup script.

Magdi

Ravi_8
Honored Contributor

Re: What kind of Shell I'm using

Hi,
#echo $SHELL gives u the which shell u r using
never give up
Ron Irving
Trusted Contributor

Re: What kind of Shell I'm using

if you type "env" at the command prompt, you will get all sorts of useful info, including:

SHELL=/sbin/sh

which is the POSIX shell.
Should have been an astronaut.
Patrick Wallek
Honored Contributor

Re: What kind of Shell I'm using

If you are logging in as root, which is what the # denotes, then you should be using /sbin/sh. You should NEVER use any shell other than that for root as it can cause problems when booting the machine or trying to bring the machine up in single-user mode.
Gregory Fruth
Esteemed Contributor

Re: What kind of Shell I'm using

The environment $SHELL tells you what shell
you get when you log in, but it doesn't get
updated dynamically. That is, after you log into
your normal shell (say, /usr/bin/sh), if you then
start ksh or csh or whatever, $SHELL will
still say /usr/bin/sh.
Sachin Patel
Honored Contributor

Re: What kind of Shell I'm using

Hi lalo,
if you are at prompt # you are most probabley a root and using /bin/sh shell.
#ps will give you what shell you are using
if you using nis
#ypcat passwd |grep username (and last part tells you your username)
if you are using local password file
#cat /etc/passwd |grep username (will work)

Sachin
Is photography a hobby or another way to spend $
Wodisch
Honored Contributor

Re: What kind of Shell I'm using

Hello Lalo,

first: if you type "echo $0" you will get the name of the
shell process running (with a leading dash, perhaps ;-)

case $0 in
-sh|sh) echo POSIX-shell ;;
-ksh|ksh) echo Korn-shell ;;
-csh|csh) echo C-shell ;;
-rsh|rsh) echo restricted POSIX-shell ;;
-dtksh|dtksh) echo DeskTop Korn-shell ;;
*') some other shell... ;;
esac

second: if the name of your process is "sh" it still could
be the old Borune-shell (/usr/old/bin/sh), but this is
not very likely...

HTH,
Wodisch