Skip to content

Instantly share code, notes, and snippets.

@alchemycs
Created February 6, 2012 00:17
Show Gist options
  • Save alchemycs/1748532 to your computer and use it in GitHub Desktop.
Save alchemycs/1748532 to your computer and use it in GitHub Desktop.
CLI to copy a template file to multiple stub files in a list
destfile1.md.sample
destfile2.md.sample
destfile3.md.sample
#!/bin/sh
while read FILE
do
cp template.md $FILE
done < destination_list.txt

Template File

This is the file you want to use as a template

The contents of this file will be copied to each file listed in the destination_list.txt

@alchemycs
Copy link
Author

Sometimes I have a file that is to be used as a template that I need to copy to multiple files that are listed in a text file.

Just thought I would share how to do it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment