Created
January 3, 2016 17:18
-
-
Save mihaeu/09f9ed70d16f2d498eaf to your computer and use it in GitHub Desktop.
work in progress ... I'll be using this to print the source code of my live coding exam at university
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
author="Michael Haeuslmann" | |
path='/home/mike/workspace/pw-online-auction/' | |
save_path='\/home\/mike\/workspace\/pw-online-auction\/' | |
output="test.pdf" | |
printf "# Prüfung Professionelle Webentwicklung\n\nAuthor: $author\n\nDatum: `date`\n\n" > test.md | |
find $path -type f -name '*.php' -print0 | while IFS= read -r -d '' file; do | |
printf '%s\n' "$file" | |
printf "##" >> test.md | |
echo $file | sed "s/$save_path//" >> test.md | |
printf "\n" >> test.md | |
printf "\n" >> test.md | |
printf '```php' >> test.md | |
printf "\n" >> test.md | |
cat "$file" >> test.md | |
printf "\n" >> test.md | |
printf '```' >> test.md | |
printf "\n" >> test.md | |
printf "\n" >> test.md | |
done | |
pandoc test.md -o $output && rm test.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment