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?
|
Normally, "echo $SHELL" will tell you what shell is being used - eg /bin/bash, /bin/tcsh, /bin/zsh or whatever.
--Ian |
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.
|
Code:
echo $0 |
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. |
Yes not from within a script, from a console
|
Yes If you have some experience with DOS,it is exactly like %0
|
I thought we were talking of real shells only, not toys :)
How do you do it? Code:
H:\>echo %0 Just interested... |
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 |
All times are GMT -5. The time now is 06:13 PM. |