From b00ca1074abd00286d945063d2ac33ad8a056f2d Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Thu, 12 May 2011 14:17:05 +0200 Subject: [PATCH] Simplified check for done task. Use simple comparison with slice of string (already used e.g. in _list()) instead of grep -c pipeline. Closes #42 --- todo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.sh b/todo.sh index 6e4e090..ca45f3d 100755 --- a/todo.sh +++ b/todo.sh @@ -954,7 +954,7 @@ case $action in [ -z "$todo" ] && die "TODO: No task $item." # Check if this item has already been done - if [ $(echo $todo | grep -c "^x ") -eq 0 ] ; then + if [ "${todo:0:2}" != "x " ]; then now=$(date '+%Y-%m-%d') # remove priority once item is done sed -i.bak $item"s/^(.) //" "$TODO_FILE"