Last Updated: February 25, 2016
·
520
· adamellsworth

shell script to batch-create files and add content from list

I've recently started creating a full library of Bootstrap 3 snippets for Brackets, and to accomplish the glyphicon lib with relative ease I generated a list of all glyphicon names (copy/pasted from the website) and used the shellscript below to go through the list and generate .snippet files with their respective snippet content.

#!/bin/bash
cat names.txt | while read name
do
    filename=glyph-${name}.snippet
    echo "<span class=\"glyphicon glyphicon-${name}\"></span>" >> ${filename}
done

https://github.com/adamellsworth/brackets-bootstrap3-snippets