#!/usr/bin/env bash scriptDir=$( dirname -- "$0"; ) cd "$scriptDir/.." || exit for file in $(grep -l '\[Generate\]' *.cs) do filename=$(basename -- "$file") class="${filename%.*}" echo "generating $filename" sed "s/Template/$class/g" "./Generator/Template.txt" > "./$class.generated.cs" done