LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-14-2004, 03:43 PM   #1
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Rep: Reputation: 15
How to know what is the current (not initial) shell?


How to know what is the current (not initial) shell?
 
Old 09-14-2004, 03:45 PM   #2
serz
Member
 
Registered: Apr 2003
Location: Buenos Aires, Argentina
Distribution: Slackware, Gentoo
Posts: 397

Rep: Reputation: 30
cat $SHELL
 
Old 09-14-2004, 05:10 PM   #3
rytrom
LQ Newbie
 
Registered: Jul 2003
Posts: 27

Original Poster
Rep: Reputation: 15
it shows an initial shell. If you logged in with csh and then typed 'bash' how to see that bash is the actual current shell?
 
Old 09-14-2004, 07:09 PM   #4
dsegel
Member
 
Registered: Aug 2004
Location: Davis, California
Distribution: Gentoo, always Gentoo.
Posts: 159

Rep: Reputation: 30
Do you mean programatically or just for your own knowledge?

Try typing 'ps'. It should show you both the original and current shell running.

If you start with bash the $BASH or $shell variables might contain your current shell.

Last edited by dsegel; 09-14-2004 at 07:11 PM.
 
Old 09-15-2004, 02:37 AM   #5
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
I did not test, but if your write a shell script, it can get the PID of the parent process (the shell). Then in Linux, you can go and see where /proc/<pid>/exe is pointing to.

Yves.
 
Old 09-15-2004, 01:17 PM   #6
[NL]_Target
Member
 
Registered: Aug 2003
Distribution: Arch Linux 0.7
Posts: 81

Rep: Reputation: 15
echo $SHELL should "allways" show the current shell, if set up correctly that is...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with X consoles - "shell-init: error retrieving current directory" lowpro2k3 Slackware 4 03-26-2007 06:36 PM
Determining current shell subu_s Programming 11 01-04-2005 07:10 AM
how can I change the current shell on the fly? Xavius Linux - Newbie 5 04-06-2004 08:00 AM
Finding information about the current shell atirya_yodha Linux - Newbie 3 03-18-2004 01:30 PM
current Slack-Current giving troubles? r_jensen11 Slackware 5 02-02-2004 05:08 PM


All times are GMT -5. The time now is 10:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration