From a239479b6e3b307dbb0031552f86364ff3610364 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 6 Mar 2012 10:58:12 +0100 Subject: [PATCH] allow directories for archival in .calendar Signed-off-by: Nico Schottelius --- show_calendar | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/show_calendar b/show_calendar index 472ad0e..408de69 100755 --- a/show_calendar +++ b/show_calendar @@ -2,7 +2,8 @@ # # Nico Schottelius # Date: 13-May-2003 -# Last Modified: 2004-09-06 +# Modified: 2004-09-06 +# Modified: 2012-03-06 # usage: show_calendar [date] # Format: DD.MM., DD.MM.YYYY # add $CALDIR/files: @@ -19,10 +20,9 @@ if [ $# -lt 1 ]; then exit 1 fi -cd $CALDIR -for file in *; do - for date in $@ TO.DO; do - #egrep --with-filename -A 2 -e "^${date}[:\.]" "$file" - egrep --with-filename -A 2 -e "^${date}:" "$file" - done +grep_param="-e ^TO.DO:" +for arg in "$@"; do + grep_param="${grep_param} -e ^${arg}:" done + +find "$CALDIR" -type f -exec egrep --with-filename -A 2 "$grep_param" {} \;