listcon/listproj: Work around bug in older GNU greps.
Commit df4f9150 introduced the use of "grep -w -o". This
combination was broken from the introduction of -o (in 2001) until
subsequent release of GNU grep 2.5.3 in 2007---see changelog for
2005-11-10. In particular, OS X uses a pre-2.5.3 version
of GNU grep.
Work around by replacing with two greps: one to find maximal
strings with @s in them (still relying on -o) and the second to
extract contexts.
Reported by Jon Smajda <jon@smajda.com>; fix developed
in conjunction with Philippe Teuwen <phil@teuwen.org>.
Signed-off-by: Emil Sit <sit@emilsit.net>
This commit is contained in:
4
todo.sh
4
todo.sh
@@ -726,11 +726,11 @@ case $action in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"listcon" | "lsc" )
|
"listcon" | "lsc" )
|
||||||
grep -w -o '@[^ ]\+' "$TODO_FILE" | sort -u
|
grep -o '[^ ]*@[^ ]\+' "$TODO_FILE" | grep '^@' | sort -u
|
||||||
cleanup ;;
|
cleanup ;;
|
||||||
|
|
||||||
"listproj" | "lsprj" )
|
"listproj" | "lsprj" )
|
||||||
grep -w -o '+[^ ]\+' "$TODO_FILE" | sort -u
|
grep -o '[^ ]*+[^ ]\+' "$TODO_FILE" | grep '^+' | sort -u
|
||||||
cleanup ;;
|
cleanup ;;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user