• Packt logo
  • FutureLearn logo
New

Introduction to Bash Script Automation

Hone your Bash scripting skills to help you automate repetitive tasks and boost productivity with this practical online course.

A woman sits at a desk on a computer with a blue background.

Gain a solid understanding of Bash shell scripting

Many organisations favour Bash scripts for executing shell commands and automating repetitive tasks. Therefore, Bash scripting skills are highly sought-after and can help you advance your automation career.

On this five-week course, you’ll learn Bash shell scripting in detail and understand how to apply the acquired skills confidently in the real world.

You’ll start with introductory topics and finish with a practical exercise of designing a simple digital clock and automating multiple server inventory using shell scripts.

Explore test command and arithmetic operators

You’ll become familiar with arithmetic and redirection operators and explore different commands, including test and grep.

Next, you’ll write a simple script to get to grips with using functions such as echo command, variables, strings, comments, and debugging.

Delve into arrays

You’ll explore more advanced topics such as conditional statements and loops before putting your knowledge into practice and demonstrating how to schedule jobs.

Then, you’ll gain an introduction to arrays and in particular, arrays of Bash shell scripting. With this knowledge, you’ll be able to use arrays as a tool to store multiple pieces of the same type of data.

Understand SED command

In order to master server management, you’ll learn how to log into the remote server from the local server using ssh. Within this, you’ll also learn how to use a shell script to execute commands on different servers.

Finally, you’ll explore SED (stream editor) to understand how to use it as a powerful tool to filter or transform text.

By the end of the course, you’ll have become well-versed in Bash shell scripting and developed the skills to automate repetitive tasks.

Syllabus

  • Week 1

    Basic steps to write shell script, redirection operators and commands

    • Introduction to the course

      Welcome to Introduction to Bash Script Automation and the start of your learning journey, brought to you by Packt.

    • Setting up your environment and installing Ubuntu

      In this activity, we will explore setting up your environment to practice bash shell scripting and install Ubuntu on Windows 10.

    • Writing shell script, general commands, configuring Gmail and Docker Installation

      In this activity, we will discuss the basic steps to write and execute a shell script. We will also learn about general commands, configuring Gmail and installing Docker on an Ubuntu server.

    • Redirection operators and commands to read file content

      In this activity, we will discuss redirection operators and commands to read the content of a file.

    • Grep command

      In this activity, we will discuss the basic and advanced usage of the grep command.

    • Cut command, AWK command and other useful commands

      In this activity, we will discuss the cut command, the AWK command as well as other simple, but useful commands for bash shell scripting.

    • Wrap up

      You have reached the end of Week 1. In this activity, you'll reflect on what you have learned.

  • Week 2

    Basic shell scripting, string operations, commands and arithmetic operators

    • Introduction to Week 2

      Welcome to Week 2. In this activity we'll highlight the main topics that will be covered this week.

    • Basics of shell scripting

      In this activity, we will discuss the echo command and variables.

    • Here string, writing comments and debugging

      In this activity, we will discuss here string. You’ll also learn about writing comments and debugging bash shell script.

    • String operations and input and output commands

      In this activity, we will discuss basic string operations as well as input and output commands for bash shell scripting.

    • Arithmetic operators, case statements, test commands and command chaining

      In this activity, we will discuss arithmetic operators, and the usage of case statements, test commands and command chaining.

    • Wrap up

      You have reached the end of Week 2. In this activity, you'll reflect on what you have learned.

  • Week 3

    Conditional statements, scheduling jobs, arrays and loops

    • Introduction to Week 3

      Welcome to Week 3. In this activity we'll highlight the main topics that will be covered this week.

    • Conditional statements

      In this activity, we will discuss simple if and if-else conditional statements. We’ll also explore verifying the user is root or not, starting Docker service and using logical AND, OR and NOT operators.

    • Old and new test commands, conditional statements and command line arguments

      In this activity, we will discuss the differences between old and new test commands. We’ll also explore conditional statements and command line arguments.

    • Scheduling jobs

      In this activity, we will discuss scheduling jobs with at and crontab.

    • An introduction to arrays and loops

      In this activity, we will discuss arrays, associative arrays and loops.

    • Loop control commands, statements, and for loop with arrays

      In this activity, we will discuss the difference between $@ and $*, loop control commands, or statements, as well as For loop with arrays.

    • Wrap up

      You have reached the end of Week 3. In this activity, you'll reflect on what you have learned.

  • Week 4

    Remote servers, loops, functions, printf command, and AWK command

    • Introduction to Week 4

      Welcome to Week 4. In this activity we'll highlight the main topics that will be covered this week.

    • Working with remote servers

      In this activity, we will discuss working with remote servers.

    • Loops, loop control statements, and functions

      In this activity, we will discuss loops, loop control statements, and functions.

    • Complete printf command and an introduction to the AWK command

      In this activity, we will discuss the printf command and start exploring the AWK command.

    • Defining variables, reading variable values and more about the AWK command

      In this activity, we will discuss defining variables, displaying variables, and executing multiple statements. You’ll also discover more about reading variable values and using the AWK command.

    • Wrap up

      You have reached the end of Week 4. In this activity, you'll reflect on what you have learned.

  • Week 5

    Complete sed command and practical exercises

    • Introduction to Week 5

      Welcome to Week 5. In this activity we'll highlight the main topics that will be covered this week.

    • Complete sed command

      In this activity, we will discuss complete sed command, viewing and searching file content as well as finding and replacing with sed command.

    • Sed command with regex

      In this activity, we will discuss sed command with regex, specifically deep-diving in regex with special characters.

    • Practice exercises part 1

      In this activity, we will practice how to design a simple digital clock, how to automate server inventory and how to automate the inventories of multiple servers.

    • Practice exercises part 2

      In this activity, we will practice how to monitor file system usage and how to automate the installation of required git versions.

    • Final week wrap up

      You have reached the end of this course. In this activity, you will reflect on what you have learned.

When would you like to start?

Start straight away and join a global classroom of learners. If the course hasn’t started yet you’ll see the future date listed below.

Learning on this course

On every step of the course you can meet other learners, share your ideas and join in with active discussions in the comments.

What will you achieve?

By the end of the course, you‘ll be able to...

  • Identify several different commands.
  • Experiment writing basic bash shell script.
  • Explore arithmetic operators.
  • Discuss conditional statements, functions and arrays.
  • Describe loops and loop control statements.
  • Practice the skills you learned in this course.

Who is the course for?

This course is designed for anyone interested in Bash shell scripting and developing key skills in automation.

Who developed the course?

Packt

Founded in 2004 in Birmingham, UK, Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals.

FutureLearn

FutureLearn is jointly owned by The Open University and The SEEK Group and has been providing online courses for learners around the world over the last eight years.

What's included?

This is a premium course. These courses are designed for professionals from specific industries looking to learn with a smaller group of like-minded individuals.

  • Unlimited access to this course
  • Includes any articles, videos, peer reviews and quizzes
  • Certificate of Achievement to prove your success when you're eligible
  • Download and print your Certificate of Achievement anytime

Still want to know more? Check out our FAQs

Learning on FutureLearn

Your learning, your rules

  • Courses are split into weeks, activities, and steps to help you keep track of your learning
  • Learn through a mix of bite-sized videos, long- and short-form articles, audio, and practical activities
  • Stay motivated by using the Progress page to keep track of your step completion and assessment scores

Join a global classroom

  • Experience the power of social learning, and get inspired by an international network of learners
  • Share ideas with your peers and course educators on every step of the course
  • Join the conversation by reading, @ing, liking, bookmarking, and replying to comments from others

Map your progress

  • As you work through the course, use notifications and the Progress page to guide your learning
  • Whenever you’re ready, mark each step as complete, you’re in control
  • Complete 90% of course steps and all of the assessments to earn your certificate

Want to know more about learning on FutureLearn? Using FutureLearn

Do you know someone who'd love this course? Tell them about it...