Welcome to the what and why of bash scripting. In this chapter, you will discover the types of shells in Linux and why we chose bash. You will learn what bash is, how to write your first bash script, and how to run it. Also, you will see how to configure Linux editors, such as vim and nano, in order to type your code.
Like in any other scripting language, variables are the basic blocks of coding. You will learn how to declare variables such as integers, strings, and arrays. Furthermore, you will learn how to export these variables and extend their scope outside the running process.
Finally, you will see how to visually debug your code using Visual Studio Code.
We will cover the following topics in this chapter:
- Types of Linux shells
- What is bash scripting?
- The bash command hierarchy
- Preparing text editors for scripting
- Creating and executing scripts
- Declaring variables
- Variable scope
- Command substitution
- Debugging your scripts