|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How do you know what shell you're in? I'm not looking for my login shell, but the one that i'm in currently.
Example: bash-2.03$ csh aries% ksh $ What indicates that i'm in the c shell or the korn shell? |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
at your shell prompt type echo $SHELL or take a look at your passwd entry in /etc/passwd to see what your default shell is.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
How do you know what your current shell is?
hmm... I must not be asking my question correctly.. sorry... newbie.
I start out in a bash shell, I change to the korn shell... what tells me that i've changed shells? Can you tell by the prompt? |
|
#4
|
|||
|
|||
|
Bourne-type shells (that includes bash and ksh) have a $ in front of them. The C shell uses a %, and I think tcsh uses a >.
If you're a super-user or root, you're going to have a hash mark (#) in front no matter what. You can grep the /etc/passwd file with your username to find out what shell starts up on default (it's the last field), but I'm not sure if there is a command or variable that tells the active shell. |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
I think you asked correctly, I missunderstood. I wouldnt go by the shell prompt since you can easily change that (though it may have historical significance as to the shell it represents) Here is a way to get what your after...using the PID from the shell that your in see who the owner of that process is.
echo $$ # Gives the Parent Process ID ps -ef | grep $$ | awk '{print $8}' #use the PID to see what the process is. |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I know my current shell | ynixon | UNIX for Dummies Questions & Answers | 3 | 07-02-2008 03:32 PM |
| How to run a new shell with copy of current shell declarations? | alex_5161 | Shell Programming and Scripting | 9 | 06-02-2008 01:48 AM |
| How do i execute script in the current shell | Naresh Kumar | Shell Programming and Scripting | 5 | 06-12-2006 11:55 AM |
| Command to findout the current shell? | Aceform | UNIX for Dummies Questions & Answers | 5 | 09-07-2005 12:00 PM |
| current shell | mkan | Shell Programming and Scripting | 3 | 02-21-2005 06:20 AM |
|
|