Remove gawk and uniq dependencies for listcon, listproj.

Implement listcon and listproj in terms of grep -w -o, which prints
words that match the given regular expression, and sort -u, which
obviates uniq.  This probably only works with GNU grep, which seems
better than having to rely on gawk (which is used nowhere else).

Signed-off-by: Emil Sit <sit@emilsit.net>

Signed-off-by: Gina Trapani <ginatrapani@gmail.com>
This commit is contained in:
Emil Sit
2009-03-26 09:56:22 +08:00
committed by Gina Trapani
parent 5cc988102d
commit df4f9150cf

View File

@@ -687,11 +687,11 @@ case $action in
;;
"listcon" | "lsc" )
gawk '{for(i = 1; i <= NF; i++) print $i}' "$TODO_FILE" | grep '@' | sort | uniq
grep -w -o '@[^ ]\+' "$TODO_FILE" | sort -u
cleanup ;;
"listproj" | "lsprj" )
gawk '{for(i = 1; i <= NF; i++) print $i}' "$TODO_FILE" | grep '+' | sort | uniq
grep -w -o '+[^ ]\+' "$TODO_FILE" | sort -u
cleanup ;;