Intro to UNIX Shells
By Ken Dennis A UNIX Shell is in simplest terms, a command line interpreter, that takes the users input and gives it to the Kernel. If you are familiar with DOS, you will remember the 'command.com' that file takes the users information and passes it to the operating system in a way it can be understood by the system. With DOS you only had one type of shell, but with UNIX you have a variety, each with their own abilities, pluses and minuses. Keep in mind as you read about these shells, that though they may have major differences when they were created, that they have been updated and many features that were once only available in a single shell, may be available in other shells. This is more of a history lesson. 'sh'
'csh'
'ksh'
'bash'
There are many other shells out there, but chances are if you are using a UNIX style operating system, you are using one of the above mentioned shells. My personal favourite is the bash shell, which also happens to be the first one I was exposed towards, so I may be biased. However typically when shell scripting, I use the korn shell because of its programming friendly structure. How do you know what UNIX shell I am using? Type "ps" and then hit return at your shell prompt and you should get something similar to: $ ps
The numbers under PID, TTY, TIME etc should all be different from machine to machine, and the number of lines of programs running may also. But one line you have will be probably "bash" "csh" "sh" "ksh". Another way to check is to type the following: grep your-user-name /etc/passwd (eg grep ken /etc/passwd) Which will return you something along the lines of: ken:x:501:501:Ken:/home/ken:/bin/bash The last portion of that line is '/bin/bash' which tells you your default shell when you login. Ken Dennis
Quick Links:
Unix Books :-
Unix Home: Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|