This course provides a comprehensive guide to Bash shell scripting for Unix/Linux environments, teaching you how to automate tasks and interact efficiently with the operating system. You’ll start with the basics of shell scripting, including environment setup, variables, conditional statements, loops, and functions. The course also covers essential Unix tools such as grep, awk, and sed for data manipulation, along with working on remote servers and interacting with REST APIs. Through practical projects and real-world examples, you will gain hands-on experience in automating repetitive tasks, managing system configurations, and enhancing productivity. By the end of the course, you will be proficient in creating robust Bash scripts to streamline workflows and optimize Unix/Linux system administration.
Who should take this Course?
The Bash Shell Scripting Online Course is ideal for system administrators, DevOps engineers, and IT professionals who want to automate tasks, manage servers, and streamline workflows using Bash scripting. It is also suitable for students, beginner programmers, and technology enthusiasts seeking hands-on experience in writing scripts to enhance productivity and efficiently handle Linux/Unix environments.
What you will learn
Write and execute Bash shell scripts in Unix/Linux environments
Utilize filters such as grep, awk, and sed for data manipulation
Apply conditional statements, loops, and functions for decision-making
Interact with remote servers and REST APIs
Use regular expressions for text pattern matching
Practical projects enhance Linux/Unix administration and DevOps skills
Course Outline
Introduction
Introduction
Prerequisites to the Course
Who Can Enroll in This Course?
Environment Setup to Practice with Bash Shell Scripting
Environment Setup to Practice with Bash Shell Scripting
Installing Any Linux Distribution And CentOS on Windows with WSL
Enabling systemctl on WSL CentOS
Configuring Gmail Setup on CentOS
Accessing Windows Files from WSL Centos or WSL CentOS Files from Windows
Basic Steps to Write and Execute a Bash Shell Script
Different Ways to Execute a Shell Script
How to Use CentOS Terminal on Visual Studio Code Editor
chmod Command Won't Work by Default on WSL Linux
Install Tools Such as Docker, Ansible, Java, nginx, and httpd with a Bash Script
Basic Understanding of Bash Shell Scripting
Basic Understanding of Shell Script Execution
Usage of Semicolon; in Bash Shell Scripts
Variables
Introduction to Variable: What Is Variable and Define Variables with Differences
Default Value of a Variable and How to Unset or Clear or Delete Variable Values
Types of Variables
Rules to Define Variables
What Is a Syntax in Bash Shell Scripting
Inputs and Outputs
Inputs and Outputs for Variables in Bash Shell Scripting
Echo Command and Basic Usage of the Echo Command
Practice with Variables and Echo Command
Link Windows Path to Non-Root User Home of WSL OS
Echo Command with Options Part-2
How to Get the Colorful Output from Bash Shell Scripts
Read Command
Source Command to Read Inputs for Variables
Export Command to Provide Inputs for Variables
Command-Line Arguments to Provide Inputs for Variables of Bash Shell Script
Shift Command with Command-Line Arguments
String Operations
Basic Operations on String
String Operations on Paths
Arrays
Introduction to Arrays
Accessing Array Elements and Operations on Arrays
Why We Need Arrays
How to Provide Inputs for Arrays
Bash Dictionaries | Bash Associative Arrays
Introduction to Bash Dictionaries
Basics of Commands
Exit Status of a Command
Redirection Operators and STDIN, STDOUT, and STDERR
How to Execute Any Command with the Help of a Variable?
How to Use the Cut Command to Get Required Columns/Fields and Characters
How to Use an awk Command to Get the Required Filed/Column or Line
Basics of grep Command
How to Use Variables in grep Command?
Introduction to sed Command and Usage of Variables
sed Command with Find and Replace | How to Use Different Delimiters in sed
sed Command with Inserting and Deletion of Lines Using Line Numbers and Search
Best Example to Use the tr Command with Cut and Then with kill-9
Arithmetic Operations for Integers and Floating Point Numbers
Working with Command-Chaining Operators
List of Command-Chaining Operators
Command-Chaining Operator - Pipe
Command-Chaining Operator - Semicolon
Command-Chaining Operators - Logical AND and OR
How to Find the Location or Path of Any Command or Installed Package
Shell Script to Get the Location of Any Package
Executing the Block of Code
Simple Practice
How to Get the Latest File or Directory from the Current Location
Test Command and Conditional Statements
How to Use the Test Command to Validate a Condition
Exit Command and Its Usage
Introduction to If and If-Else Statements
Debugging a Bash Shell Script
Shell Scripting Practice
Write a Shell Script to Read a Given File Content
Write a Shell Script to Install Packages Using Yum
The if, elif, elif else, and Case Statements
The if, elif, and elif else Statements
Case Statement
Write a Shell Script to Find the Version for a Given Tool
Shell Script to Send All DevOps Tools Information to Mail
Scheduling Jobs
Scheduling Jobs with at Command
Scheduling Jobs with crontab
Comments and Logging
Comments and Logging
Functions
Introduction to Functions
Defining a Function and Calling It with and Without Arguments
How to Pass Strings or Text as an Argument
Shell Script to Install Packages with Functions
Scope of Variables
How to Reuse Function in Different Shell Scripts
Here Document and Here String
Heredoc and Herestr
Loops
Introduction to Bash Loops with an Example
For Loop Syntax and Its Usage
Working with Arrays Using For Loop
Simple Practice with For Loops
Send an Automatic Mail Alert When the Secret File Is Deleted
Break and Continue Statements
While Loop Part-1
While Loop Part-2
Until Loop with Example
Select Loop and Its Usage with an Example
Practice for You
While Loop with getopts Command to Read Arguments
Working with REST APIs Using the Curl Command
How to Validate the REST API Execution with the Curl Command?
Working with Remote Servers
Introduction to Work with Remote Servers
Shell Script to Execute a Command on Remote Hosts Using When They Used SSH Keys
How to Provide Password for ssh with sshpass? | There Are Three Ways
Working with SCP to Transfer a File from the Local Server to the Remote Server
How to Provide a Password for ssh or scp Using Expect Command?
Real-Time Practice
Monitor a Service(s) on the Host for Every Minute; If Not Running Then Send a Mail
Shell Script to Monitor a Microservice with Its Health URL
Monitor Application Log Directory | Alert If the Application Is Not Generating Logs
Install the Required Git Version on the Host
Regular Expressions | Regex
Introduction to Regular Expressions or Regex
Creation of Pattern or Extended Regular Expressions or ERE
Write a Shell Script to Get the Latest Git Version from the git-scm Website