2023-05-24 23:33:36 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
function get_task_value {
|
2023-05-25 16:36:03 +02:00
|
|
|
echo "$task_data" | grep "^$1" | sed -E "s/^$1 +//"
|
2023-05-24 23:33:36 +02:00
|
|
|
}
|
|
|
|
|
2023-05-25 16:36:03 +02:00
|
|
|
ids=$(task limit:none recur | grep -E '^ ?[[:digit:]].*[[:alpha:]].*[[:digit:]]$' | sed -E 's/^ ?([[:digit:]]+) .*/\1/')
|
2023-05-24 23:33:36 +02:00
|
|
|
excluded_ids=$(for id in $ids
|
2023-05-25 16:36:03 +02:00
|
|
|
do
|
|
|
|
task_data="$(task $id)"
|
|
|
|
echo "$(get_task_value 'Parent task') $(get_task_value 'Description' | sed 's/ /_/g') $(get_task_value 'Due') $id"
|
|
|
|
done | sort | rev | uniq -f3 | rev | sed -E 's/.* ([[:digit:]]+)$/\1/')
|
2023-05-24 23:33:36 +02:00
|
|
|
|
|
|
|
del_ids=$(for id in $excluded_ids $ids
|
2023-05-25 16:36:03 +02:00
|
|
|
do
|
|
|
|
echo $id
|
|
|
|
done | sort | uniq -u)
|
2023-05-24 23:33:36 +02:00
|
|
|
|
2023-05-25 16:36:03 +02:00
|
|
|
if [ ! -z "$del_ids" -a "$del_ids" != " " ]
|
|
|
|
then
|
|
|
|
task $del_ids del
|
|
|
|
fi
|