What is Linux Shell?
Computer only knows and understands the language of zeros and ones which is known as binary language. In early days of computing, instruction provided using binary language, which is difficult for all of us, to understand, read and write. Therefore, in operating system there is special program called shell. Shell accepts your instruction or commands in english language and if it is a valid command, kernel will process your request.
Shell is a user program or it is environment provided for user interaction. It a command language interpreter that executes commands read from the standard input device (keyboard) or from a file. To find all available shells in your system type following command: Quote:
Under MS-DOS, shell name is COMMAND.COM which is also used for same purpose, but it is not as powerful as our Linux Shells are! Command line interface (CLI) Shell provides an interface to the Linux where you can type or enter commands using the keyboard it know as command line interface (CLI). To find out your current shell type following command: Quote:
|
Quote:
The SHELL variable is bash specific: Code:
$ echo $SHELL |
Quote:
http://en.wikipedia.org/wiki/Linux_Shell Quote:
Quote:
|
Quote:
|
Quote:
|
simple way to define a shell is CLI with the kernel so that user can inter-react eaisily .
here are several different shells available for Unix; the most popular are described here. You can use any one of these shells if they are available on your system. And you can switch between the different shells once you have found out if they are available. Bourne shell (sh) C shell (csh) TC shell (tcsh) Korn shell (ksh) Bourne Again SHell (bash) |
Quote:
will this work Quote:
|
Quote:
EDIT: Using ps -p $$ shows the current shell that is being used. |
Quote:
csh # echo $0 csh # |
@jheengut:
Code:
[plains] druuna ~ $ csh |
root@:/home/pritvi# which echo
/usr/bin/echo root@:/home/pritvi# echo $0 /bin/bash root@:/home/pritvi# csh # which echo Quote:
PID TTY TIME CMD 1704 pts/8 00:00:00 bash root@:/home/pritvi# csh # ps -p $$ PID TTY TIME CMD 5206 pts/8 00:00:00 csh # /usr/bin/echo $0 csh why does your's echo does not work ??? |
Quote:
Quote:
Quote:
Using ps -p $$ is the only way that I know of that returns the correct shell that is being used. All other methods I've tried and seen can go wrong in one way or another. |
Quote:
|
Quote:
Windows (which replaced DOS over a decade ago) has cmd.exe and command.com and, more recently, PowerShell which is arguably as good as anything available for Linux. That's ignoring VBScript and Javascript used as macro languages as well as third party tools such as KixTart scripting. Is this post the prelude to some SPAM or just ill-informed? |
Powershell is nice but it still doesn't have anything on bash.
|
All times are GMT -5. The time now is 11:03 PM. |