LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Finding information about the current shell (http://www.linuxquestions.org/questions/linux-newbie-8/finding-information-about-the-current-shell-159366/)

atirya_yodha 03-18-2004 08:13 AM

Finding information about the current shell
 
How do I find out the information about the current shell ?
ie , whether it is bash,csh or korn shell etc ?
The reason i ask this question is that i want to make the vi
editor commands to work on the command line . I tried using
set -o vi
but the shell says "set: Variable name must begin with a letter."
Does set -o vi work only with bash ?
I wanted to find out what is my current shell and accordingly make
vi editor commands to work on the shell command line for editing

Thanks,
Athirya

snacky 03-18-2004 08:18 AM

1. "grep `whoami` /etc/passwd" to find out what shell you run at login.
2. If you're the only one on the system, "ps |grep sh" would be a reasonable way to find out what shell you're running at the moment.

slakmagik 03-18-2004 10:19 AM

Code:

~
1008>> echo $0                                                               
bash

~
1009>> set -o vi

Works fine with my bash - maybe you're not using bash. It probably is bash-specific.

mightymouse 03-18-2004 01:30 PM

most shells have a number of environment variables set to provided information about them. You can find out what shell you are using by typing "echo $SHELL". If you are using bach, then have a look at the man page, specifically the "bash variables" section.


All times are GMT -5. The time now is 06:32 PM.