Summary

Learn the scenarios when you need a Bash script.

We'll cover the following

Scripts features

While we solved the backup task, we considered the basic features of Bash scripts. Let’s make a summary of their features.

Below are the requirements for the backup task:

  1. The backup command should have long-term storage.
  2. There should be a way to call the command quickly.
  3. It should be a possibility to extend the command by new features.
  4. The command should be able to combine with other commands.

The final version of the make-backup.sh script meets all these requirements. Here are the solutions for each requirement:

  1. The hard disk stores the script file. It is long-term memory.

  2. The script is easy to integrate with Bash. Then you can call it quickly.

  3. The script is a sequence of commands. Each one starts on a new line. You can read and edit it easily. Thanks to parameterization, you can generalize the script for solving tasks of the same type.

  4. Due to integration with Bash, you can combine the script with other commands.

If our task requires any of these features, we can write a Bash script for that.

Get hands-on with 1200+ tech skills courses.