From df4f9150cf9b9e49ecac12a8729a31c3a2003e32 Mon Sep 17 00:00:00 2001 From: Emil Sit Date: Thu, 26 Mar 2009 09:56:22 +0800 Subject: [PATCH] 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 Signed-off-by: Gina Trapani --- todo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo.sh b/todo.sh index 44a190a..e57dde3 100755 --- a/todo.sh +++ b/todo.sh @@ -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 ;;