<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How do I  find out what shell I&#8217;m using?</title> <atom:link href="http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Victor</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-179057</link> <dc:creator>Victor</dc:creator> <pubDate>Tue, 07 Feb 2012 13:09:58 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-179057</guid> <description>LOL, just what I was thinking. ^^</description> <content:encoded><![CDATA[<p>LOL, just what I was thinking. ^^</p> ]]></content:encoded> </item> <item><title>By: ujjal</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-177295</link> <dc:creator>ujjal</dc:creator> <pubDate>Wed, 21 Dec 2011 12:29:33 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-177295</guid> <description>you can also use
ps &#124; grep $$</description> <content:encoded><![CDATA[<p>you can also use<br
/> ps | grep $$</p> ]]></content:encoded> </item> <item><title>By: CRP</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-173683</link> <dc:creator>CRP</dc:creator> <pubDate>Fri, 02 Sep 2011 19:51:41 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-173683</guid> <description>This is not 100% accurate.
&lt;ul&gt;
&lt;li&gt;echo $SHELL and other similar methods print the name the current shell is called in the current environment.&lt;/li&gt;
&lt;li&gt;sh --version, on the other hand, prints the version of the default shell&lt;/li&gt;
&lt;li&gt;If you combine them, you can spawn another process, running the same shell as the parent, and ask it what is its version.&lt;/li&gt;
&lt;/ul&gt;
Example (note how my shell is given the name &quot;csh&quot;, but it is really a tcsh):
&lt;pre&gt;
[me@localhost ~]$ echo $SHELL
/bin/csh
[me@localhost ~]$ sh --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
[me@localhost ~]$ $SHELL --version
tcsh 6.14.00 (Astron) 2005-03-25 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
&lt;/pre&gt;</description> <content:encoded><![CDATA[<p>This is not 100% accurate.</p><ul><li>echo $SHELL and other similar methods print the name the current shell is called in the current environment.</li><li>sh &#8211;version, on the other hand, prints the version of the default shell</li><li>If you combine them, you can spawn another process, running the same shell as the parent, and ask it what is its version.</li></ul><p>Example (note how my shell is given the name &#8220;csh&#8221;, but it is really a tcsh):</p><pre>
   [me@localhost ~]$ echo $SHELL
    /bin/csh
   [me@localhost ~]$ sh --version
    GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
    Copyright (C) 2005 Free Software Foundation, Inc.
   [me@localhost ~]$ $SHELL --version
    tcsh 6.14.00 (Astron) 2005-03-25 (x86_64-unknown-linux) options wide,nls,dl,al,kan,sm,rh,color,filec
</pre>]]></content:encoded> </item> <item><title>By: Giuseppe Bertone</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-173637</link> <dc:creator>Giuseppe Bertone</dc:creator> <pubDate>Tue, 30 Aug 2011 11:01:28 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-173637</guid> <description>Hi John,
&lt;pre&gt;ps -p $$&lt;/pre&gt; and &lt;pre&gt;echo $0&lt;/pre&gt; always return the current shell, even from a sub-shell because they print the current process.
The &lt;em&gt;/etc/passwd&lt;/em&gt; file is simply a file and then it does not store the current user shell but the login shell. In your example, you are using the &lt;em&gt;Change login shell&lt;/em&gt; (chsh) to actually change the shell automatically launched at your login, and this is why the change is immediately visible in the /etc/passwd file.</description> <content:encoded><![CDATA[<p>Hi John,</p><pre>ps -p $$</pre><p> and<pre>echo $0</pre><p> always return the current shell, even from a sub-shell because they print the current process.</p><p>The <em>/etc/passwd</em> file is simply a file and then it does not store the current user shell but the login shell. In your example, you are using the <em>Change login shell</em> (chsh) to actually change the shell automatically launched at your login, and this is why the change is immediately visible in the /etc/passwd file.</p> ]]></content:encoded> </item> <item><title>By: cindy</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-170448</link> <dc:creator>cindy</dc:creator> <pubDate>Sun, 03 Apr 2011 00:48:52 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-170448</guid> <description>pwd.</description> <content:encoded><![CDATA[<p>pwd.</p> ]]></content:encoded> </item> <item><title>By: Tim Jowers</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-169152</link> <dc:creator>Tim Jowers</dc:creator> <pubDate>Thu, 24 Feb 2011 20:37:35 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-169152</guid> <description>$ bash
in
[a148503@wuvra99a0219 logs]$ uname -a
Linux wuvra99a0219 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
$SHELL is the only thing remaining as ksh:
[a148503@wuvra99a0219 logs]$ ps -$$
PID TTY      STAT   TIME COMMAND
18336 pts/13   S      0:00 bash
[a148503@wuvra99a0219 logs]$ echo $SHELL
/usr/bin/ksh
[a148503@wuvra99a0219 logs]$ echo $0
bash</description> <content:encoded><![CDATA[<p>$ bash<br
/> in<br
/> [a148503@wuvra99a0219 logs]$ uname -a<br
/> Linux wuvra99a0219 2.6.18-194.8.1.el5 #1 SMP Wed Jun 23 10:52:51 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux</p><p>$SHELL is the only thing remaining as ksh:</p><p>[a148503@wuvra99a0219 logs]$ ps -$$<br
/> PID TTY      STAT   TIME COMMAND<br
/> 18336 pts/13   S      0:00 bash<br
/> [a148503@wuvra99a0219 logs]$ echo $SHELL<br
/> /usr/bin/ksh<br
/> [a148503@wuvra99a0219 logs]$ echo $0<br
/> bash</p> ]]></content:encoded> </item> <item><title>By: san</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-168014</link> <dc:creator>san</dc:creator> <pubDate>Wed, 05 Jan 2011 17:53:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-168014</guid> <description>you can also use
ps -u</description> <content:encoded><![CDATA[<p>you can also use</p><p>ps -u</p> ]]></content:encoded> </item> <item><title>By: john fuller</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-160479</link> <dc:creator>john fuller</dc:creator> <pubDate>Wed, 27 Oct 2010 18:33:30 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-160479</guid> <description>I noticed that, command such as; ps -$$, echo $SHELL, echo $0, printenv will print the current shell, but In case you have temperoraly changed your shell, these commands will not show the changes, unless you log out and log In. Whereas, cat /etc/passwd file will show the change mmediately without loging out.
For ex: At the current shell (ex-/bin/bash), if you type &#039;chsh&#039; and then enter /bin/tcsh, it will change the shell to &#039;tcsh&#039;, but the cmds mentioned above will still be reporting the old shell that is /bin/bash, unless you logout. But, /et/passwd file will show the changes immediately.</description> <content:encoded><![CDATA[<p>I noticed that, command such as; ps -$$, echo $SHELL, echo $0, printenv will print the current shell, but In case you have temperoraly changed your shell, these commands will not show the changes, unless you log out and log In. Whereas, cat /etc/passwd file will show the change mmediately without loging out.</p><p>For ex: At the current shell (ex-/bin/bash), if you type &#8216;chsh&#8217; and then enter /bin/tcsh, it will change the shell to &#8216;tcsh&#8217;, but the cmds mentioned above will still be reporting the old shell that is /bin/bash, unless you logout. But, /et/passwd file will show the changes immediately.</p> ]]></content:encoded> </item> <item><title>By: akshay</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-160221</link> <dc:creator>akshay</dc:creator> <pubDate>Tue, 19 Oct 2010 11:37:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-160221</guid> <description>ps -p $$
and
echo $0
thanks a lot!</description> <content:encoded><![CDATA[<p>ps -p $$<br
/> and<br
/> echo $0</p><p>thanks a lot!</p> ]]></content:encoded> </item> <item><title>By: gitterrost4</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-159706</link> <dc:creator>gitterrost4</dc:creator> <pubDate>Sun, 19 Sep 2010 07:42:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-159706</guid> <description>Thanks for this.
But the last sentence...
&quot;Or better try out following if you have a bash shell:
MYSHELL=$(ps -hp $$&#124;awk &#039;{echo $5}&#039;)
&quot;
If you have a bash shell, couldn&#039;t you just do
MYSHELL=&quot;bash&quot;
?</description> <content:encoded><![CDATA[<p>Thanks for this.<br
/> But the last sentence&#8230;</p><p>&#8220;Or better try out following if you have a bash shell:<br
/> MYSHELL=$(ps -hp $$|awk &#8216;{echo $5}&#8217;)<br
/> &#8221;</p><p>If you have a bash shell, couldn&#8217;t you just do<br
/> MYSHELL=&#8221;bash&#8221;<br
/> ?</p> ]]></content:encoded> </item> <item><title>By: Suneelm</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-158232</link> <dc:creator>Suneelm</dc:creator> <pubDate>Wed, 21 Jul 2010 10:16:09 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-158232</guid> <description>Thanks ..</description> <content:encoded><![CDATA[<p>Thanks ..</p> ]]></content:encoded> </item> <item><title>By: lee murray</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-157527</link> <dc:creator>lee murray</dc:creator> <pubDate>Thu, 08 Jul 2010 11:58:57 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-157527</guid> <description>exactly what i was looking for. thanks</description> <content:encoded><![CDATA[<p>exactly what i was looking for. thanks</p> ]]></content:encoded> </item> <item><title>By: ashwin</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-156410</link> <dc:creator>ashwin</dc:creator> <pubDate>Tue, 08 Jun 2010 16:22:16 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-156410</guid> <description>You can also find this out from et/passwd file :
Command to run:
#  cat /etc/passwd</description> <content:encoded><![CDATA[<p>You can also find this out from et/passwd file :</p><p>Command to run:<br
/> #  cat /etc/passwd</p> ]]></content:encoded> </item> <item><title>By: maki</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-156060</link> <dc:creator>maki</dc:creator> <pubDate>Mon, 17 May 2010 16:22:29 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-156060</guid> <description>-hp might not work. Also, echo?
ps h -p $$ &#124; awk &#039;{print $5}&#039;</description> <content:encoded><![CDATA[<p>-hp might not work. Also, echo?</p><p>ps h -p $$ | awk &#8216;{print $5}&#8217;</p> ]]></content:encoded> </item> <item><title>By: Paul Harper</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-144233</link> <dc:creator>Paul Harper</dc:creator> <pubDate>Mon, 30 Jun 2008 16:49:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-144233</guid> <description>you can also use
echo $0</description> <content:encoded><![CDATA[<p>you can also use<br
/> echo $0</p> ]]></content:encoded> </item> <item><title>By: Akram</title><link>http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-143143</link> <dc:creator>Akram</dc:creator> <pubDate>Wed, 12 Mar 2008 11:51:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/how-do-i-find-out-what-shell-im-using.html#comment-143143</guid> <description>thanks this is what i looking for</description> <content:encoded><![CDATA[<p>thanks this is what i looking for</p> ]]></content:encoded> </item> </channel> </rss>
