Skip to content

Instantly share code, notes, and snippets.

@LadyAleena
Last active August 17, 2020 06:56
Show Gist options
  • Select an option

  • Save LadyAleena/82db71d68175e58af782ff0839be4176 to your computer and use it in GitHub Desktop.

Select an option

Save LadyAleena/82db71d68175e58af782ff0839be4176 to your computer and use it in GitHub Desktop.
#!/bin/bash
find . -type f -name "$1" -print0 | sort -z | while IFS= read -rd "" path; do
output=$(perlcritic -"$2" --color "$path");
if [[ $output = *OK ]]; then
printf "%s\n" "$output";
else
printf "\n%s\n%s\n\n" "$path" "$output";
fi;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment