Skip to content

Instantly share code, notes, and snippets.

@prophile
Created March 24, 2010 22:55
Show Gist options
  • Select an option

  • Save prophile/342930 to your computer and use it in GitHub Desktop.

Select an option

Save prophile/342930 to your computer and use it in GitHub Desktop.
#!/bin/bash
MAINCLASS=FractalApp
find . -name '*.java' | xargs cat | grep "^import " | sort | uniq
find . -name '*.java' | grep -v $MAINCLASS | sort | xargs cat | grep -v "^import " | sed s/public\ class/class/g | sed s/public\ interface/interface/g | sed s/public\ abstract\ class/abstract\ class/g
find . -name $MAINCLASS.java | xargs cat | grep -v "^import "
SLASH="/"
STAR="*"
OPENCOMMENT=$SLASH$STAR
CLOSECOMMENT=$STAR$SLASH
echo ""
echo "$OPENCOMMENT Single file compiled with shell script:"
cat $0
echo $CLOSECOMMENT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment