From 90d18d739207c8e84c952c3272653b024efea46b Mon Sep 17 00:00:00 2001 From: Daniel Mowitz Date: Wed, 24 May 2023 23:33:36 +0200 Subject: [PATCH] Upload files to '' --- clean-tw.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 clean-tw.sh diff --git a/clean-tw.sh b/clean-tw.sh new file mode 100644 index 0000000..56dc2bb --- /dev/null +++ b/clean-tw.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +function get_task_value { + echo "$task_data" | grep "^$1" | sed -E "s/^$1 +//" +} + +ids=$(task limit:none recur | grep -E '^ +[[:digit:]].*[[:alpha:]].*[[:digit:]]$' | sed -E 's/^ +([[:digit:]]+) .*/\1/') + +excluded_ids=$(for id in $ids + 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/') + +del_ids=$(for id in $excluded_ids $ids + do + echo $id + done | sort | uniq -u) + +task $del_ids del