Introduction to Bash Scripting
Chapters
If you are looking for a beginer's course for Bash scripting, This course is very well for you. I've covered some of the most important topics to get you started. Course contents include
- Welcome message [Free]
- What is Bash
- Command line shortcuts and tricks
- Getting started with Bash profiles
- Bash Expansions
- Command Redirection and Piping
- Using Echo and PrintF and how to preventing command expansion
- Understanding local and environment variables
- Bash script syntax
- A basic Bash script
- Working with numbers and operators
- Working with arrays
- Controlling output with awk, grep and cut commands. How to use basic bash color themes with your output.
- Working with here document and files
- Flow control statements and loops
- Introduction to functions
- Interacting with user
- Closing note
I hope that you will learn heaps from this course, please leave your feedback and improvement suggestions.
Author: Subject Coach
Added on: 23rd Jan 2015
Please get in touch with your teacher or tutor in case you have a question related to this lesson
None just yet!
Bash is a Unix shell written by Brian Fox, for the GNU Project as a free software replacement for the Bourne shell. It is also known as Bourne again shell. Bash was first released in 1989. It however has a long history, starting with Thompson shell in 1971, which was very basic to what it had to offer. It was replaced by Mashey shell in 1975, which later in 1977 was replaced by Bourne shell, developed by Stephen Bourne. Features such as, Scripts invoked as commands by using their filename, or, provide flow control construct made it an instant hit.
Born was born, as the result of not enough features were being added to Bourne shell. Brian Fox wanted to develop something that could run existing scripts, and is also free to use. Thus Bash was born, it was developed under Gnu project, which made it a free alternative. There were other shells developed too, such as C shell, K shell etc. Korn Shell or K shell is a default shell for Solaris. Bash shell is a SH compatible shell that also incorporates useful features from C shell and K shell.
As of 1994 Chet Ramney took over Bash maintainer. Updates and release information is available from chet's official Bash page.
The improvements offered by Bash include:
Command line editing, Unlimited size command history, Job Control, Shell Functions and Aliases, Indexed arrays of unlimited size, Integer arithmetic in any base from two to sixty-four etc.
All of the current default shells, in different operating system are somewhat inspired from Bourne Shell. Current Bash version is 4.3 however! most Linux systems are using bash 4.2. Bash makes scripting easy with functionality it has to offer.
All of the Bourne shell built-in commands are available in Bash, The rules for evaluation and quoting are taken from the POSIX specification for the standard Unix shell.
With Bash shell you get building blocks such as commands, control structures, shell functions, shell parameters, shell expansions, redirections, which are a way to direct input and output from and to named files, and how the shell executes commands.