What You Learned

You worked with two approaches to automate tasks: Makefiles and Bash scripts. Makefiles are great for situations where you’re creating output files. Scripts, on the other hand, offer more flexibility. In both cases, you’re able to use all the command-line tools and techniques you’ve learned so far.

To make creating your scripts easier, use the contents of your Bash history as a starting point. You can dump your history to a file with history > script.sh and then use your editor to turn it into a script. Or you can use the script command to record a shell session and then convert the log to a script.

You’re not limited to these choices. If you find Bash scripting too obtuse for your liking, you can use other languages to get the same results. Perl and Python are available on most systems out of the box and make great choices for creating scripts, as it’s very easy to call out to external programs.

In the next chapter, you’ll install and explore some additional tools that make it easier to manage files, manage environment variables, and much more. Then you can incorporate those into your scripts too.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.120.206