If you're interested in learning more about the power of Bash, you can read the reference manual at https://www.gnu.org/software/bash/manual/bash.pdf.
Inside the manual, you'll discover all sorts of different methods for improving the simple script we wrote in this recipe. Alternatively, Python has a robust reference manual as well if you're interested in using Python to automate some of the tasks. The Python manual for Python 2.7 is located at https://docs.python.org/2/, while Python 3 reference documents are found at https://docs.python.org/3.7/.
Alternatively, there are many great Python books available on the Packt Publishing website at https://www.packtpub.com. Make sure to learn the differences between Python 2 and Python 3 if you plan on making a script that is compatible with both versions.