Bash Scripting Flow Control and Data Types


Overview/Description
Target Audience
Prerequisites
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
Bash syntax is a scripting language used for data manipulation. During this course, you will learn how to form conditional statements and evaluate them with the Bash test command tool. Begin by creating compound conditional statements with comparison operators. Next, learn how to use a for loop construct within a Shell script. Other topics include wildcards, while loops, until loops, break and continue commands, and case statements. From there you will observe how to create an array, and manipulate data. Then discover how to perform simple math operations, calculate floating point math, and convert numbers between bases. Conclude by employing Bash's string manipulation operations and learn the basic syntax to manipulate strings, directories, and directory structures.

Target Audience
System administrators, DevOPS, software developers, and users who may need to create scripts to automate processes in a Linux or Linux-like environment

Prerequisites
None

Expected Duration (hours)
1.4

Lesson Objectives

Bash Scripting Flow Control and Data Types

  • 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
  • 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
  • work with conditional statements, loops, and arrays in Bash scripts and manipulate string and numeric data
  • Course Number:
    os_doss_a02_it_enus

    Expertise Level
    Intermediate