LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-18-2004, 09:13 AM   #1
LQ Newbie
Registered: Mar 2004
Posts: 1

Rep: Reputation: 0
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

Old 03-18-2004, 09:18 AM   #2
Registered: Feb 2004
Distribution: Debian
Posts: 286

Rep: Reputation: 30
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.
Old 03-18-2004, 11:19 AM   #3
Senior Member
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
1008>> echo $0                                                                 

1009>> set -o vi
Works fine with my bash - maybe you're not using bash. It probably is bash-specific.
Old 03-18-2004, 02:30 PM   #4
Registered: Mar 2004
Posts: 31

Rep: Reputation: 15
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.


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
finding information on image properties datatab1 Programming 4 10-07-2005 02:16 AM
How to get the current process information Programming 4 09-29-2005 05:39 AM
Finding what the current desktop is ashusharma Programming 8 07-15-2004 10:01 AM
Need help finding information for Mandrake. CyberLord_7 Mandriva 3 10-15-2003 04:30 PM
Finding current load on the system kbeaver Linux - Newbie 2 09-04-2003 11:41 PM

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

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