I’m a reporter who uses the following command to create a story folder with subfolders for each new story I begin:
/bin/mkdir -p ~/Desktop/NewStory/{Copy,Data,Notes,PubMaterial,RefMaterial,Media/{Audio,Images,Video}}
It works like a charm, but I’d also like to create a text file in the “Data” subfolder called “DataJournal.txt” and I don’t know how to do that.
Going one step further, I’d like to add the four headings of my data journals:
—Data Folder Setup
—Data Introduction
—Data Audit/Manipulation
—Data Queries
I can create such a text file now using an echo command but I have no idea how to work this into the command that creates the folders/subfolders. I’d be grateful for any help!
Just wrap the entire thing into a shell script and execute that instead of the
mkdircommand.Adding a little generality the use of this script would be
bash script-name.sh StoryNameas$1is interpolated into the first argument passed to the script. ( Or just./script-name.sh StoryNameif you happened tochmod +xit so it is executable ).