Skip to content

Instantly share code, notes, and snippets.

@gimler
Created July 4, 2018 20:20
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 gimler/12abdcda96b24995986be48ced70dcac to your computer and use it in GitHub Desktop.
Save gimler/12abdcda96b24995986be48ced70dcac to your computer and use it in GitHub Desktop.
Simple bash script to find files where the class name not match the file name
find tests -name '*Test.php' -exec sh -c 'FILEPATH={}; FILE=${FILEPATH##*/}; FILEBASE=${FILE%.php}; if ! grep -q $FILEBASE $FILEPATH; then echo $FILEPATH \($FILEBASE\); fi' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment