nsbin/plan-of-week
Nico Schottelius 854dd306d6 only 10 items from today
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
2014-06-10 10:34:23 +02:00

35 lines
544 B
Bash
Executable file

#!/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
date="$(date +%F)"
file="$HOME/privat/persoenlich/notizen/$date"
if [ -f "$file" ]; then
echo "$date"
head -n 10 "$file"
fi
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