Friday, 15 November 2013

What The Hell is A Shell?!

I've had a lot of people ask this question before, myself included. I thought I would write a small straight to the point post about the differences between the most common.

I'll start by explaining exactly what a shell is and what it is used for. (Although most of you will probably already know)

What the hell is a shell?!
Before graphical user interfaces the command line was the main interface for users, just like now where we have KDE, Gnome etc... the command line had shells. Shells were used to give the user a slightly different environment in terms of functionality and scripting. In technical terms a shell is a command line interpreter developed to make things easier for users. One example of this would be filename/command completion (do this by pressing tab after the first part of the command/filename). These small features that a lot of people see as part of linux is actully part of the shell.

Popular shells
The most popular shell (and the shell most of you will probably be using) is the Bash Shell written by a guy called Brian Fox. This is the most popular shell due to its robustness and tons of features. I use this shell at home all the time for scripting.

The Bourne Shell, AKA 'sh'. This shell was developed by a guy called Stephen Bourne, It quickly became the default shell for Unix due to its support for variables, piping, looping and a verity of other usefull stuff. I use this shell mainly when writing software for embedded systems as it is the default shell.

The C-Shell AKA 'csh' was developed by a guy called Bill Joy. This guy added useful things like aliases (short cuts for long commands) and command history. This shell was modeled on the C programming language, this was a good thing as Unix was written in C...although it did mean users of the bourne shell had to learn C in order to use the C-Shell.

Which is the best shell?
There are a large number of shells to choose from, I've only named three here as these are the most popular. I would say the best shell is the Bash Shell due to how popular it is, this means most scripts written with this shell will most likely work on any machine.

No comments:

Post a Comment