plan-of-week 544 Bytes
Newer Older
Nico Schottelius's avatar
+plan  
Nico Schottelius committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/sh
# Nico Schottelius
# 2014-06-08
# Show the plan of the week


if [ "$#" -ne 1 ]; then
    echo "$0 <directory-with-notes>"
    exit 1
fi

dir=$1; shift

start=1
end=7

day=$start

Nico Schottelius's avatar
Nico Schottelius committed
19 20 21 22 23 24 25
date="$(date +%F)"
file="$HOME/privat/persoenlich/notizen/$date"
if [ -f "$file" ]; then
    echo "$date"
    head -n 10 "$file"
fi

Nico Schottelius's avatar
+plan  
Nico Schottelius committed
26 27 28 29 30 31 32 33 34 35
while [ "$day" -le "$end" ]; do
    date="$(date +%F -d "$day days")"
    file="$HOME/privat/persoenlich/notizen/$date"

    if [ -f "$file" ]; then
        echo "$date"
        cat "$file"
    fi
    day=$((day+1))
done