ADDED: new_source script to automate creating foo.c and foo.h

This commit is contained in:
Fletcher T. Penney 2016-08-29 19:01:25 -04:00
parent 96ba8c25d3
commit b0ed20e58f

13
new_source Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
FILE=$1
cp build/template.c src/$FILE.c
perl -pi -e "s/file\.c/$FILE\.c/;" -e "s/file\.h/$FILE\.h/;" src/$FILE.c
cp build/template.h src/$FILE.h
perl -pi -e "s/file\.c/$FILE\.c/;" -e "s/file\.h/$FILE\.h/;" -e "s/FILE\_/\U$FILE\_/;" src/$FILE.h