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:
- The backup command should have long-term storage.
- There should be a way to call the command quickly.
- It should be a possibility to extend the command by new features.
- 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:
-
The hard disk stores the script file. It is long-term memory.
-
The script is easy to integrate with Bash. Then you can call it quickly.
-
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.
-
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.