logo

utils

~/.local/bin tools and git-hooks
commit: b7614a805a6ef25eb82019d6244b73b8e770b705
parent: a2df2088e4492a9ce23481dda43b334a77f3bbb7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  8 Jan 2019 05:55:08 +0100

bin/timey-whyme.sh: Use cut(1) to strip out #comments instead of grep ^#

Diffstat:

Mbin/timey-whyme.sh12++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/timey-whyme.sh b/bin/timey-whyme.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright CC-BY-SA-4.0 2017- Haelwenn (lanodan) Monnier <contact@hacktivis.me> +# Copyright CC-BY-SA-4.0 2017-2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me> xdd="${XDG_DATA_DIR:-$HOME/.local/share}/timey-whyme" today="$(date --date=now +%Y-%m-%d)" @@ -16,18 +16,18 @@ verify_xxd() { todo() { verify_xxd todo.csv - echo ",0,###, To Do, ### + echo ",0,### To Do, , ### ${today},###, Now +7 days, ### -${later},###, Later,### -$(grep -av '^#' "$xdd/todo.csv")" | sort -n | $form +${later},###, Later,### +$(cut -d '#' -f -1 "$xdd/todo.csv" | grep -v '^$')" | sort -n | $form } calendar() { verify_xxd calendar.csv echo "0000-00-00,###, Calendar, ### ${today},###, Now +7 days, ### -${later},###, Later,### -$(grep -av '^#' "$xdd/calendar.csv")" | sort -n | $form +${later},###, Later,### +$(cut -d '#' -f -1 "$xdd/calendar.csv" | grep -v '^$')" | sort -n | $form } case "$1" in