Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 78 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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