Automating File and Directory Creation
Learn how to automate file and directory creation.
We'll cover the following...
We'll cover the following...
One of the best things about automation is that you can put in a little extra work up front and get a lot of reward out of that work down the road.
Using bash for automation
A typical website has a home page, at least one style sheet, a folder for images, and, most likely, some JavaScript files. So, let’s use Bash to automate that. We’ll have the script create a root directory for the website, an index.html
file, a scripts
directory, an images
directory, and a stylesheets
directory. And we’ll drop a style.css
file in the stylesheets
directory for good measure:
The script
Using what we learned in Working with Files and Directories, ...