Skip to content

Instantly share code, notes, and snippets.

@plehr
Last active January 15, 2019 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plehr/f22652885caab4cb8577aa6a09006e2c to your computer and use it in GitHub Desktop.
Save plehr/f22652885caab4cb8577aa6a09006e2c to your computer and use it in GitHub Desktop.
Tiny bash script to zip java files and compile it to check zip file. Include warning against german special character
#!/bin/bash
## Tiny bash script to check files (maybe sourcecode?) against special characters.
## Author: plehr.de
echo "Executed:" >output.log
date >> output.log
echo " - - - - - - - - - Start Pre-Check - - - - - - - - -" | tee -a output.log
fgrep -Fn 'ä' *java | tee -a output.log
fgrep -Fn 'Ä' *java | tee -a output.log
fgrep -Fn 'ö' *java | tee -a output.log
fgrep -Fn 'Ö' *java | tee -a output.log
fgrep -Fn 'ü' *java | tee -a output.log
fgrep -Fn 'Ü' *java | tee -a output.log
fgrep -Fn 'ß' *java | tee -a output.log
fgrep -Fn '€' *java | tee -a output.log
fgrep -Fn '@' *java | tee -a output.log
fgrep -Fn 'ß' *java | tee -a output.log
fgrep -Fn 'package' *java | tee -a output.log
fgrep -Fn 'import' *java | tee -a output.log
echo " - - - - - - - - - End Pre-Check - - - - - - - - -" | tee -a output.log
echo "are you sure?"
read a
rm Ü2G8_Prog1_WS2018-2019.zip | tee -a output.log
zip Ü2G8_Prog1_WS2018-2019.zip *pdf Mitglieder.txt *java -x Prog1_Blatt_??.pdf | tee -a output.log
echo " - - - - - - - - - Start Post-Check - - - - - - - - -" | tee -a output.log
unzip Ü2G8_Prog1_WS2018-2019.zip -d /tmp/check >> output.log
javac /tmp/check/*java | tee -a output.log
rm -r /tmp/check | tee -a output.log
echo " - - - - - - - - - End Post-Check - - - - - - - - -" | tee -a output.log
echo "File created!" | tee -a output.log
ls -lh Ü2G8* | tee -a output.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment