From 272cd5e469a5e44680befa663c0771f12f67bb6e Mon Sep 17 00:00:00 2001 From: Ingo Karkat Date: Fri, 23 Dec 2011 22:52:07 +0100 Subject: [PATCH] Optimization: Put grep -v empty task filter inside sed. No need to spawn off another process for this; we can do this inside the sed command that joins the task numbers with the task text. --- todo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/todo.sh b/todo.sh index 3fabaff..30dbd6d 100755 --- a/todo.sh +++ b/todo.sh @@ -779,8 +779,8 @@ _list() { N s/^/ / s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 / - ''' \ - | grep -v "^[ 0-9]\+ *$" + /^[ 0-9]\+ *$/d + ''' ) if [ "${filter_command}" ]; then filtered_items=$(echo -n "$items" | eval "${filter_command}")