diff --git a/todo.sh b/todo.sh index bfd0014..843ed86 100755 --- a/todo.sh +++ b/todo.sh @@ -629,7 +629,7 @@ case $action in [ -z "$todo" ] && die "$item: No such todo." [[ "$item" = +([0-9]) ]] || die "$errmsg" - sed -e $item"s/^(.*) //" "$TODO_FILE" > /dev/null 2>&1 + sed -e $item"s/^(.) //" "$TODO_FILE" > /dev/null 2>&1 if [ "$?" -eq 0 ]; then #it's all good, continue @@ -653,7 +653,7 @@ case $action in now=`date '+%Y-%m-%d'` # remove priority once item is done - sed -i.bak $item"s/^(.*) //" "$TODO_FILE" + sed -i.bak $item"s/^(.) //" "$TODO_FILE" sed -i.bak $item"s|^|&x $now |" "$TODO_FILE" newtodo=$(sed "$item!d" "$TODO_FILE") [ $TODOTXT_VERBOSE -gt 0 ] && echo "$item: $newtodo" @@ -807,11 +807,11 @@ note: PRIORITY must be anywhere from A to Z." [[ "$item" = +([0-9]) ]] || die "$errmsg" [[ "$newpri" = +([A-Z]) ]] || die "$errmsg" - sed -e $item"s/^(.*) //" -e $item"s/^/($newpri) /" "$TODO_FILE" > /dev/null 2>&1 + sed -e $item"s/^(.) //" -e $item"s/^/($newpri) /" "$TODO_FILE" > /dev/null 2>&1 if [ "$?" -eq 0 ]; then #it's all good, continue - sed -i.bak -e $2"s/^(.*) //" -e $2"s/^/($newpri) /" "$TODO_FILE" + sed -i.bak -e $2"s/^(.) //" -e $2"s/^/($newpri) /" "$TODO_FILE" NEWTODO=$(sed "$2!d" "$TODO_FILE") [ $TODOTXT_VERBOSE -gt 0 ] && echo -e "`echo "$item: $NEWTODO"`" [ $TODOTXT_VERBOSE -gt 0 ] && echo "TODO: $item prioritized ($newpri)."