In this course, you will learn how to control the flow inside a Bash script using conditions and loops. You will also learn about some of the advanced features and capabilities of strings, numbers, and arrays.
Learning Objectives
Flow Control
- start the course
- work with conditional statements in Bash scripts and use the built-in test command to evaluate expressions
- recognize numeric, string, and test comparison operators and create compound conditional statements
- work with for loops and wildcards
- use while and until loops to iterate through a list or run until a condition is achieved
- use break and continue to control the iterations of a loop
- create a case statement and use it in place of a nested if statement
Arrays, Strings, and Numbers
- create an array by adding and removing elements and manipulate the data in the array
- perform simple math operations in a Bash script and use the bc utility to do floating point math
- create and use a Bash script to convert numbers between different bases
- manipulate strings using the built-in Bash string manipulation operations
- use popd, pushd, dirs, pwd, cd, and $DIRSTACK to work with directories and directory structures in a Bash script
Practice: Conditionals and Data Types
- work with conditional statements, loops, and arrays in Bash scripts and manipulate string and numeric data