Parsing ICS file with bash
<p>This is a google calendar ics file.</p>

<p>I download it each time to check whether new play events have been added or changed and I appear on IRC.</p>

<p>I need convert a file like this :</p>

<pre><code>BEGIN:VEVENT
DTSTART:20160612T201000Z
DTEND:20160612T211000Z
DTSTAMP:20160519T200239Z
UID:xxxxxxxxxxxxxxxxxx@google.com
CREATED:20160518T153226Z
DESCRIPTION:
LAST-MODIFIED:20160518T153226Z
LOCATION:OCS Choc
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Ash vs Evil Dead Saison 1 Episode 9 &amp; 10
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=Europe/Brussels:20160611T203500
DTEND;TZID=Europe/Brussels:20160611T233500
DTSTAMP:20160519T202440Z
UID:xxxxxxxx@google.com
RECURRENCE-ID;TZID=Europe/Brussels:20160611T203500
CREATED:20160503T144152Z
DESCRIPTION:
LAST-MODIFIED:20160518T123213Z
LOCATION:RTS Un (Suisse)
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:The Mysteries Of Laura Saison 2 Episode 1 à 4
TRANSP:TRANSPARENT
END:VEVENT
</code></pre>

<p>to</p>

<pre><code>New Events Created :
dim. juin 12  20:10  Ash vs Evil Dead Saison 1 Episode 9 &amp; 10 - OCS Choc

Last Modified Event :
sam. juin 11  20:35  The Mysteries Of Laura Saison 2 Episode 1 à 4 - RTS Un (Suisse)
</code></pre>

<p>I need convert with a bash script. 
I have to get :</p>

<p>DTSTART
CREATED
LAST-MODIFIED
LOCATION
SUMMARY</p>

<p>And i need compare CREATED and LAST-MODIFIED</p>

<p>pseudo-code :</p>

<pre><code>if (created = LastModified)
then 
     echo createdevent
else
     echo lastModifiedEvent
fi
</code></pre>