Created
August 24, 2015 22:57
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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