Welcome to shellscript.co.uk a small resource on shell scripting.

Apologies, this site is still a work in progress.


Q: What do I need to write shell scripts?
A: Any text editor will do weather it's a command line editor like Vi, Emacs or Nano. Or even a graphical editor like gedit, kate or mousepad.

Q: How can I make my scripts executable?
A: chmod u+x /foo/bar (were /foo/bar is the location and name of your script)

Q: What extension do I have to use for my scripts.
A: It's common practise to use .sh for shell script extensions but it's not necessary, it's more for the users benefit, so they know what it is.

Q: How can I find out what shell I'm using?
A: Open a terminal and enter this line 'echo $SHELL' make sure that $SHELL is all upper case.

echo $SHELL

Q: Why is the hash and the exclamation mark (#!) called a shebang?
A: In UNIX circles an exclamation mark is often referred to as a 'Bang' while in music circles the hash is referred to as a sharp so for some reason you put the two together and you get shebang.

Quote: "If you don't want to be replaced by a computer, don't act like one." - Arno Penzias