Beginning Programming by Shell Scripting with BASH
Welcome to this mini-series of video tutorials where we look to assist you in shell scripting using the BASH shell. Shell Scripting of any variety is often the first journey in becoming a programmer. Starting with BASH shell scripts you can quickly move onto other scripting languages such as Python or Perl before moving into Java or C.
Firstly we will start with the basics of creating and debugging scripts before moving onto IF statements, CASE statements, flow control with loops and all that you may want to do to get started with scripting with /bin/bash. Fearing the shell is not something you should ever concern yourself with so if you do not understand some of these terms right now you will later. For the moment all that we would expect is that you can access the command line on Linux and know some basic commands.
- Creating, executing and debugging BASH scripts: Learn the basic of shell scripting by creating your own script and learn where they should be located.
- Using snippet libraries with vi and mapping keys to actions: Using code snippets is a great time saver when writing BASH or any type of script.
- Simple If Statement: Learn how to create a simple conditional statement in BASH.
- Using if, elif and else statements: Conditional statements can be extended beyond the basic If statement.
- Using Script Arguments: Script arguments allow you to modify your program on the fly.
- Gather User Input in Scripts: Learn ways to collect input from your users as the script executes.
- Using CASE statements: Better than using elif we may find many conditions need a case statement.
- Looping with WHILE: Looping allows us to repeat commands.
- Looping with UNTIL: Looping with until.
- Using FOR loops: More looping structure using FOR.
- Using traps and interrupts: Ctrl+c is a signal that we can send to scripts. Maybe we want to trap this signal and control how it is used.
- Brighten your output with a little color: Color makes everything better.
- Reading CSV files: Reading data from CSV files and making it display well.
- A better lastlog format: Providing a better output to standard commands.
- Delete files once they have been read: PXE boot servers are great but see how we can make them better with scripts.
- Command line menus: Operators often need a menu of commands they can run.