![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 | Thread Starter | Forum | Replies | Last Post |
| How to run a new shell with copy of current shell declarations? | alex_5161 | Shell Programming and Scripting | 9 | 06-01-2008 10:48 PM |
| current running process in shell | moco | Shell Programming and Scripting | 1 | 04-11-2007 08:15 PM |
| How do i execute script in the current shell | Naresh Kumar | Shell Programming and Scripting | 5 | 06-12-2006 08:55 AM |
| Command to findout the current shell? | Aceform | UNIX for Dummies Questions & Answers | 5 | 09-07-2005 09:00 AM |
| current shell | mkan | Shell Programming and Scripting | 3 | 02-21-2005 04:20 AM |
|
|
Submit Tools | LinkBack | 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? |
| Forum Sponsor | ||
|
|
|
#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.
|
|
#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. |
|
#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. |
||||
| Google The UNIX and Linux Forums |