daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. cat /Users/jwand/Documents/work.ics | sed /^X-LOTUS.*/d | sed '
  3. /^END:VCALENDAR$/ {
  4. N
  5.     /END:VCALENDAR.*BEGIN:VCALENDAR/ {
  6.         /END:VCALENDAR.*BEGIN:VCALENDAR/D
  7.         P
  8.         D
  9.     }
  10. } '  > /Users/jwand/Documents/work2.ics
  11.  
  12.  
  13. ## input:
  14.  
  15. BEGIN:VCALENDAR
  16.  
  17. # some stuff
  18.  
  19. END:VCALENDAR
  20. BEGIN:VCALENDAR
  21.  
  22. # more stuff
  23.  
  24. END:VCALENDAR
  25.  
  26.  
  27. ## goal
  28.  
  29. to get rid of all the instances of:
  30.  
  31. END:VCALENDAR
  32. BEGIN:VCALENDAR
  33.  
  34. in the middle of the file, without touching the ones at the very start or end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top