Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Created March 4, 2014 12:07
Show Gist options
  • Save fabienhinault/9345345 to your computer and use it in GitHub Desktop.
Save fabienhinault/9345345 to your computer and use it in GitHub Desktop.
append the content of files named in lines beggining with "-- append "
#!/bin/sh
# remove everything after -- /******
sed -i "/-- \/\*\*\*\*\*\*\*/q" $1
# append the content of files named in lines beggining with "-- append "
sed -n "/^-- append / s%^-- append \(.*\)$%cat \$(cygpath '\1') >> $1; echo >> $1% p" < $1 | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment