Compare commits

..

1 Commits

Author SHA1 Message Date
Ingo Karkat
4359290b3c Avoid external TR when replacing , with space.
No need for an external tool, Bash can do a global literal substitution itself.
2012-01-07 23:17:38 +01:00

12
todo.sh
View File

@@ -775,12 +775,8 @@ _list() {
fi
items=$(
sed = "$src" \
| sed '''
N
s/^/ /
s/ *\([ 0-9]\{'"$PADDING"',\}\)\n/\1 /
/^[ 0-9]\+ *$/d
'''
| sed "N; s/^/ /; s/ *\(.\{$PADDING,\}\)\n/\1 /" \
| grep -v "^[ 0-9]\+ *$"
)
if [ "${filter_command}" ]; then
filtered_items=$(echo -n "$items" | eval "${filter_command}")
@@ -995,7 +991,7 @@ case $action in
# Split multiple depri's, if comma separated change to whitespace separated
# Loop the 'depri' function for each item
for item in $(echo $* | tr ',' ' '); do
for item in ${*//,/ }; do
getTodo "$item"
if [[ "$todo" = \(?\)\ * ]]; then
@@ -1019,7 +1015,7 @@ case $action in
# Split multiple do's, if comma separated change to whitespace separated
# Loop the 'do' function for each item
for item in $(echo $* | tr ',' ' '); do
for item in ${*//,/ }; do
getTodo "$item"
# Check if this item has already been done