LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   which shell i use?? (https://www.linuxquestions.org/questions/linux-newbie-8/which-shell-i-use-439599/)

alaios 04-28-2006 02:47 AM

which shell i use??
 
Hi because i am using lot of different pcs i want to find out every time what shell the system use... Is there anyc ommand for that?

IBall 04-28-2006 03:01 AM

Normally, "echo $SHELL" will tell you what shell is being used - eg /bin/bash, /bin/tcsh, /bin/zsh or whatever.

--Ian

ethics 04-28-2006 03:27 AM

it's also contained in /etc/passwd if you need a quick way to view alot of users shells (i use it to check daemon/nobody accounts etc. have no shell.

nx5000 04-28-2006 06:11 AM

Code:

echo $0
will give you the current shell

timmeke 04-28-2006 06:27 AM

Be carefull with $0.

echo $0 gives you the name of the shell script you're running.
It only gives you the name of your shell if you type it at the command line of the shell itself.

nx5000 04-28-2006 06:33 AM

Yes not from within a script, from a console

gregorian 04-28-2006 07:39 AM

Yes If you have some experience with DOS,it is exactly like %0

nx5000 04-28-2006 09:15 AM

I thought we were talking of real shells only, not toys :)

How do you do it?

Code:

H:\>echo %0
%0

What could be results?

Just interested...

gregorian 04-29-2006 02:15 AM

echo %0 will not give you any name in DOS as there is only one type of DOS(cmd.exe is only command.com upgraded).

When you run it from within a batch file,it will return the name of the batch file without an extension.

Example:

Save this in demo.bat



Code:

echo %0
It will give the output "demo"(without quotes)


All times are GMT -5. The time now is 12:38 AM.