Skip to content

Instantly share code, notes, and snippets.

@mrrcollins
Created April 24, 2021 20:21
Show Gist options
  • Save mrrcollins/32a6fa473c7f0d808c6b865a028ecf06 to your computer and use it in GitHub Desktop.
Save mrrcollins/32a6fa473c7f0d808c6b865a028ecf06 to your computer and use it in GitHub Desktop.
#!/bin/bash
cp=""
todaylist=${1}
while read i || [[ -n $i ]]; do
if [[ "${i}" =~ [^.*]:$ ]]; then
cp=$(echo "${i}" | tr '[:upper:]' '[:lower:]')
elif [[ ! "${i}" =~ "@done" && ! "${i}" =~ "@cancelled" ]]; then
if [ ${#i} -gt 0 ]; then
if [[ "${i}" =~ "@today" ]]; then priority="(A) "; i=$(echo "${i}" | sed "s/\@today //g"); else priority="";fi
out=$(echo "${i}" | sed -E "s/\@due\(([0-9]{4})-([0-9]{2})-([0-9]{2})\)/due\:\1-\2-\3/g")
echo "${priority}${out:2} +${cp%?}"
fi
fi
done < ${todaylist}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment