
Attached to this lecture is the Power Point Slides for the Learn Bash Quickly Course.
Explore how to create a Linux virtual machine using VirtualBox, VMware Fusion, and VMware Workstation Player, plus cloud options like Azure and AWS, with Raspberry Pi as a practical alternative.
Add the shebang line #!/bin/bash to designate a bash script, then make it executable and run it with ./hello.sh. Learn how the current directory and path variable affect script execution.
Explore using bash variables to make scripts dynamic, learn to read user input with read, reference variables with $name, and the importance of double quotes for variable expansion.
Explore how bash treats variables as untyped, letting numbers, strings, or characters share a single variable. The lecture demonstrates this with age, color, year, distro, and pi.
Declare and use constant variables in bash by prefixing with read only, preventing reassignment; illustrate with pi (3.14159) and its role in calculations.
Learn to pass a single argument to a bash script using $1, replacing prompts with arguments, and count file lines with wc -l using examples like /etc/passwd.
Master bash basics by performing addition and subtraction, then multiplication and division, and powers and remainders, culminating in a calculator that converts Celsius to Fahrenheit.
Learn Bash power and remainder operations by passing two arguments to a script, using a and b, with double star for exponentiation, percent for remainder, and display results.
Learn to extract substrings in bash using a starting index and optional length with zero-based indexing, demonstrated by obtaining fedora and operating from a string.
Replace substrings in bash by updating a string variable, swapping fedora with ubuntu and free with popular. Commit changes by assignment, not just echoing.
Learn to delete substrings in bash by removing single or all occurrences using single and double forward slashes, and update variables with assignment.
Learn how to convert between uppercase and lowercase letters in bash strings using techniques like double carrot sign, double comma sign, and character class, with practical examples.
Learn to implement a Bash while loop by initializing a counter, testing the condition, and printing the first ten multiples of three, as an alternative to for loops.
Learn to traverse Bash arrays with for loops, using range or list style to print elements such as the first ten prime numbers, or arrays of users, files, and servers.
Bash Scripting comes up in almost every single DevOps Interview questions ... Be Prepared!
This course also include my 3 bestseller books (in eBook version):
Learn Bash Quickly
Learn Linux Quickly
Learn Ansible Quickly (RHCE)
Master Bash Scripting and learn how to automate boring administrative Linux tasks.
Key Features
Create and run efficient Bash scripts
Implement Bash functions
Automate complex and repetitive tasks
Course Description
Learn Bash Quickly is a fully practical hands-on course for learning bash scripting. It will get you up and running with bash scripting in no time.
First, you will break the ice with Bash scripting by creating and running a very simple "Hello World" program. Then, you will dive into the world of Bash variables, arguments, string, and arrays. Also, you will learn how to use conditional statements in your bash script. Moreover, you will explore various Bash looping constructs and get to realize how powerful they are. In addition, you will get to write Bash functions, so your code looks clean and unrepetitive. Finally, you will see how you can use bash to automate some of the tedious tasks on Linux.
By the end of this course, you will have all the skills necessarily to develop state of the art bash scripts that can automate any repetitive task you may encounter while working on Linux systems.
What you will learn
Understand how to work with Bash variables, arguments, string, and arrays.
Make your Bash scripts smarter with conditional statements.
Analyze various Bash looping constructs.
Design and create recursive Bash functions.
Automate boring administrative tasks.
Who This Course Is For
If you are tired of spending countless hours doing the same tedious task on Linux over and over again then this course is for you! Learn Bash Quickly will teach you all the skills you need to automate borings tasks in Linux. You will be much more efficient working on Linux after taking this course, more importantly, you will get more sleep, I promise you!
Learn Bash Quickly does assume prior Linux knowledge and that you have experience working on the Linux command line.
Table of Contents
Hello World
Bash Variables
Bash Script Arguments
Bash Arrays
Basic Arithmetic Operations
Bash Strings
Decision Making in Bash
Bash Loops
Bash Functions
Automation with Bash
Solutions to Bash Exercises