
Learn to write basic shell scripts for linux and unix, including hello world output, using any text editor, making scripts executable, and reading input into variables with the dollar sign.
Learn to store data in bash with variables. Use quotes for text and numbers, reference with a dollar sign, follow naming rules, and make scripts executable with chmod +x.
Learn how to pass parameters to bash scripts, access them with $0, $1, $2, and $#, make scripts executable, and manage process ids with $$ and kill.
Explore how bash if statements evaluate conditions on variables to run or skip code blocks. Master equality and not equal checks and greater than and smaller than comparisons.
Explore bash for loops and while loops to repeat code blocks a set number of times or until conditions are met, with examples from ranges, user input, and simple prints.
Replace many individual variables with arrays to store names, access items by zero-based indices in brackets, and loop over the list with a for loop to output each name.
Learn how to run multiple shell commands sequentially with a bash script, execute each line in order, and automate tasks by capturing command outputs into variables.
Build a simple bash script that outputs network information, clears the screen, prints a header, and runs commands line by line to reveal IPv4 addresses, devices, and current connections.
Learn how to redirect command output to a file in bash using the greater-than symbol. Save outputs to the home directory and verify the file contains the script's output.
Split large Bash scripts into functions to organize hundreds of commands, define them with curly braces, call by name, and reuse in loops for readability.
bash is a computer programming language and command language interpreter, usually for the UNIX operating system. The name comes from the Bourne-Again SHell. bash is a dialect of the popular bourne shell, and is one of the most popular shells for interactive use.
Scripts can be run on Linux, Mac OS X and the UNIX variants. At the end of this course, you will be able to create your own scripts.
In this course you learn the basics of bash scripting. You will learn:
How to setup a development environment for bash scripting
How to write bash scripts
How to run bash scripts
How to use variables and loops
How to use functions
much more
If you are a developer you can use this material to get an idea what is possible with bash scripting and maybe you find some useful tips and tricks. If you are a system administrator you may discover in this series of tutorials some tricks for your daily tasks or some missing tools that could help you in your work.
Bash scripts run interpretively. That means that when you run a bash script, it's just executing each command one after the other in the order in which they're written.
This is not about advanced bash techniques, but about getting a good set of basic knowledge on bash scripting. The material here will work with any version of bash and even with other shells.
I've been writing bash scripts for over a decade, and it really improved my productivity. With this course, hopefully you can do the same