diff --git a/todo.sh b/todo.sh index 7c43c1eb..026739a5 100755 --- a/todo.sh +++ b/todo.sh @@ -1346,8 +1346,8 @@ case $action in "listpri" | "lsp" ) shift ## was "listpri", new $1 is priority to list or first TERM - pri=$(printf "%s\n" "$1" | grep '^\([A-Za-z]\|[A-Za-z]-[A-Za-z]\|[A-Z][A-Z-]*[A-Z]\)$') && shift || pri="A-Z" - post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri^^}]) '" + pri=$(set -o pipefail; printf "%s\n" "$1" | grep '^\([A-Za-z]\|[A-Za-z]-[A-Za-z]\|[A-Z][A-Z-]*[A-Z]\)$' | tr '[:lower:]' '[:upper:]') && shift || pri="A-Z" + post_filter_command="${post_filter_command:-}${post_filter_command:+ | }grep '^ *[0-9]\+ ([${pri}]) '" _list "$TODO_FILE" "$@" ;;