Skip to content

Instantly share code, notes, and snippets.

@cpjhenry
Last active October 16, 2016 13:23
Show Gist options
  • Save cpjhenry/c136be4ad209c1204bdb to your computer and use it in GitHub Desktop.
Save cpjhenry/c136be4ad209c1204bdb to your computer and use it in GitHub Desktop.
TODO
#!/bin/bash
# Check for TODO notes in script directory
# 2015-02-06
# 2015-03-03 : filter out symbolic link, add formatting to display
searchloc="bin/*"
for i in $searchloc; do
[ ! -h $i ] && td=$(grep -s --exclude todo "TODO" $i)
[ ! -h $i ] && fm=$(grep -s --exclude todo "FIXME" $i)
if [ "$td" ]; then
echo "$i:"
echo "$td" | sed -e 's/^#//' -e 's/^ *//g' -e 's/^TODO//' -e 's/^ *: */ /g'
unset i
fi
if [ "$fm" ]; then
[ $i ] && echo "$i:"
echo "$fm" | sed -e 's/^#//' -e 's/^ *//g' -e 's/^FIXME//' -e 's/^ *: */ /g'
fi
unset td; unset fm
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment