#!/bin/bash ################################## # iCal export tool 1.0 # # by Fredrik Boström # # fredrik@fredrikbostrom.net # ################################## usage() { cat < $OUTDIR/${BASENAME}_${INDEX}.ics # for each file in the directory, append to outfile the event it contains sed -n '/BEGIN:VEVENT/,/END:VEVENT/ p' *.ics >> $OUTDIR/${BASENAME}_${INDEX}.ics # end the calendar echo 'END:VCALENDAR' >> $OUTDIR/${BASENAME}_${INDEX}.ics cd - INDEX=`expr $INDEX + 1` done