Please enable JavaScript eh!

 ⌘ Web Mechanic ⌘ 

Bash Scripting


Why Scripting?



Computers don't do what you want
They do what you tell them do do

If you've spent some time working with CLI in Terminal, you may have asked 'What's the advantage to scripting?'.

Here's a few good reasons why you might consider it:

Use CLI for those quick one-off jobs, ad-hoc queries, or troubleshooting

Use a script for repetitive or complex jobs, or monitoring.

With that said, we will begin with explaining what scripting means, as far as I understand it.

Scripting or programming is writing code (typing commands and text) to do specific things - telling the computer what you want it to do.

Since we're talking bash here, the commands are usually built-in commands or executable commands available to bash. Those are what we will be using.

It generally means saving those commands in a file, then executing that file to do the job, rather than entering the commands on the Command Line in a shell.

A good understanding of the commands available to you is essential - how do you ask for a coffee if you don't know the language?

If you've gone through the links up to here, you should be ready for some real work.

User Input