show_calendar 566 Bytes
Newer Older
Nico Schottelius's avatar
Nico Schottelius committed
1 2 3 4
#!/bin/sh
#
# Nico Schottelius
# Date: 13-May-2003
5 6
# Modified: 2004-09-06
# Modified: 2012-03-06
Nico Schottelius's avatar
Nico Schottelius committed
7 8 9 10 11 12 13 14 15
# usage: show_calendar <date> [date]
# Format: DD.MM., DD.MM.YYYY
# add $CALDIR/files:
# -----------------------
# cat $CALDIR/test
# 01.09: auto ansehen..
# -----------------------
#

Nico Schottelius's avatar
Nico Schottelius committed
16
CALDIR=~/.calendar/
Nico Schottelius's avatar
Nico Schottelius committed
17 18 19 20 21 22

if [ $# -lt 1 ]; then
   echo `basename $0` 'day.month [day.month.year]'
   exit 1
fi

Nico Schottelius's avatar
Nico Schottelius committed
23
# grep_param="-e ^TO.DO:"
24 25
for arg in "$@"; do
    grep_param="${grep_param} -e ^${arg}:"
Nico Schottelius's avatar
Nico Schottelius committed
26
done
27

28
set -x
Nico Schottelius's avatar
Nico Schottelius committed
29
find "$CALDIR" -type f -exec egrep --with-filename -A 2 $grep_param {} \;