Skip to content

Instantly share code, notes, and snippets.

@hlecuanda
Created August 24, 2015 22:57
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 hlecuanda/929a889d6f87e1cac3be to your computer and use it in GitHub Desktop.
Save hlecuanda/929a889d6f87e1cac3be to your computer and use it in GitHub Desktop.
quick zsh function to parse a makefile, wrote it on the command line. the grep expression does the magic
cat bsd.commands.mk |
grep -v -Ee "^\#|^$|^_|^\.|\@|^PKG|builtin" |
while read line
do
CMD=`echo $line | tr -s "\t" | cut -f2 | cut -f1 -d\ `
stat $CMD 1>>/dev/null 2>>/dev/null
if (($? )) then
echo "${CMD} failed"
else
echo "${CMD} ok"
fi
done | grep failed
@hlecuanda
Copy link
Author

the grep | tr | cut | cut pipeline render a virtually clean column... probably a sed on the pipeline wil turn this into a self-documenting function for scripts and makefiles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment