%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/share/zsh/5.8/functions/
Upload File :
Create Path :
Current File : //usr/local/share/zsh/5.8/functions/Calendar.zwc

h5.8t
Lfunctions/Calendar/afterxLfunctions/Calendar/aget
Lfunctions/Calendar/before.
Lfunctions/Calendar/calendarULfunctions/Calendar/calendar_addZLfunctions/Calendar/calendar_editLfunctions/Calendar/calendar_lockfilesgLfunctions/Calendar/calendar_parseg,Lfunctions/Calendar/calendar_readaB2&Lfunctions/Calendar/calendar_scandate.+DLfunctions/Calendar/calendar_show.e/6
lLfunctions/Calendar/calendar_showdatee/31	Lfunctions/Calendar/calendar_sort31AfdқCA 4DhACf LAf۬ACG,DA,dkAB yFAB CdyCFAA#A	1A.$r+9A,%-AB(	k4}	FA	',AC
',+A4C'4MEpEAg,ACACfۤA,2pyA
$+0A60PA:l0;AFAFqAFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # == 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt1:AGEREFtmp1AGEREFintegermtimevals1date1date2REPLYREPLY2AGEREFafter mtime >= date1 before mtime < date1 print0: must be named 'after' or 'before'AfdқCA 4DhACf LAf۬AC	G,DA	,dkAB(y
FAB C
dyC
FA
<;A+A A.,r+9A-	1A-
A..0QqA.0AB(k4FA',,IAC
',h+A1A.8r+9AB(Ck4QCFA',IA',+A4'EE4ACg,LdA\*&AfۤA,EyA1AG
A1A.Hr[9ABCf۔CFAJ$q	ABfۤFA.M4yqAPAS$qACFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # >= 1  # > 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt%Y/%m/%dtimefmt1:AGEREFtmp1AGEREF2:AGEREF2integermtimevals1date1date2REPLYREPLY2AGEREFAGEREF2AGEREF2AGEREF22,1 date2 = date1 + REPLY AGEREF2 date2 = date1 + 24 * 60 * 60  date1 <= mtime && mtime <= date2 AfdқCA 4DhACf LAf۬ACG,DA,dkAB yFAB CdyCFAA#A	1A.$r+9A,%-AB(	k4}	FA	',AC
',+A4C'4MEpEAg,ACACfۤA,2pyA
$+0A60PA:l0;AFAFqAFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # == 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt1:AGEREFtmp1AGEREFintegermtimevals1date1date2REPLYREPLY2AGEREFafter mtime >= date1 before mtime < date1 print0: must be named 'after' or 'before'AfdқCAF <A0C'p<`A,p HA`'hj"یEE$E8A4GTtJ0A,CXx0PAphA4Gp,PxAgpABfL FTABfLpFTAB4FTAf۬ABCۜA	x			A,	ABۜI



ABCU,,ABCۜ
eABۜA
p
 

AA"
A1A.#rlA$<Q
AC	fA	FA,(%A)HqA+AB/FTA
',AC
pz@`A
NMA.7r}<A8A,9zA,:@%A"";R`Ruru&A<NCA<
uACu0A1AB
A,C`A.D@QAEA,F`A.G@qA Cf۔IAFTAx\u0"A,OPA\
1
APA Cf۔AAFT0	A.X0"rA,]$A\
1
A^LA f۔AFT0
A,Q0
Aq0	Av0"
A{0"A$0AX0

A,A0	A.t0	lA.u0;A&FA'FTA,zEA.@uA(A)F!ABPA*3$AA*1A.r+r{A.IQA.r+lA.+Ad,1A,f+AC,FA,FTA.A-&qA\-jq"A .ۜ۔IA.uA/ۜ#A0\1GAAdC0+A.r+[9Al01A0۔
A0F9A1FTAQA.r+lA.+Ad21A2f+A2FA3FTA.A4AAC4ۜA4ۜ!EA4F]A5FTA6&qA+#0	A.0	A.0	;A.A. AX;
	A%!A;F9!A<FTA<f!۬"A"
A"C=fk4i"A=1A"A>ft"AC>f"A>ft#AT>	1A$#A?FU#A?fq#EA@'p##AB@X$4sq$$@FTA"A\AlCB5[YABA

A"ACA"C4$$"Cf%(%L%" C%fd%L% D%f%L%A"AD&qABEf%A"EF&AFF,&ApCF,e&ABFF&&F&'A%'A,!x''A#
1A#
'A$!(A.%((qA'()A.()A+	1A+
)A-)A.|*qA0*AMA4*ACMF%+AMftq+AMf++A4N1A8
+ACNF+A<,AlCOA=,AO-5-A.?i-qA.A&AP%xAtEA.Er-	.A.F.A,I!/ADR'AJ/A0SD$۔0E0AM81A"Od1O1QAP
+AQ1AT1ARL2A,S2A0UD$۔]3E3QAU3AX1AV10A[
+AWA\ 4AWۜHu44A_	AV_244!5I5A.`EHAX|55Ah6qAj6Am1Am6Ao\7Ar8A"tL8tp8A^v1Av8AwL9A^515Az
A"A^11A{9AC_1A!C_DA"f۔&AP_	A~9A9A`F	:QA:A:qAa1A!aD:f۔&APb	A;A9AbF9;QA;A:A4d%1%A
+Ae!1A&;A,J;A|eD$IA"Iff,LA,Cf&۔<;=-=;;q
A,m=A0gD$۔>E1?Ah"1Ap?Ah1
Ahfj?AiF?AAQ
AifjAAAjFeAAAA.BA
A"Akfk4BA8l,BAl0CdeC&A"Cmfk4CACnF&CTniA"r$oFr$ACofk4$emulatesetoptextendedgloblocallineshowlinerestlineREPLYREPLY2userangenobackupdatefmtcalendardonefileschednewfilewarnstrmywarnstrnewdateintegertimestartstoptodayndaysnextshowndonenodoneintegerverbosewarntimemywarntimetcalctschedrstatremainingintegershowcounticountrepeatingrepeattimereschedshowallbriefcalendar_entriescalendar_addlinestimescaloptsshowproglockfilesmatchmbeginmendtmplinesreplyzmodloadzsh/datetimereturnzsh/zutilzsh/filesb:zf_lnautoloadcalendar_addparsereadscandateshowlockfileszstyle:datetime:calendar:calendarfilecalendarcalendar/calendarcalendar.new.HOST.:datetime:calendar:donefiledonefiledonefilecalendar.done:datetime:calendar:showprogcalendar_show:datetime:calendar:warntimewarnstrwarnstr0:05:datetime:calendar:dateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %Ywarnstr warntime = warnstr calendar_scandateprintwarn-time value 'warnstr' not understood; using default 5 minuteswarnstr5 mins warntime = 5 * 60  warntime = REPLY calendarintegeroptioptrestoptargargvopti+1 opti++ argvopti2argvopti3,1optbreakBCnSoptrest opti < # argv++opti0: option -opt requires an argument.optarg brief <= 0 0: option -opt requires a positive integer.calendarshowcount showcount <= 0 0: option -opt requires a positive integer.s.:.optarg showall = 1  brief = 1  done = 1  nodone = 1  remaining = 1 showcount0: unrecognised option: -optoptrest1optrest2,1caloptsargv1,optishift( opti ) done && !nodone donefile # > 1 || (# == 1 && remaining) EPOCHSECONDS0: failed to parse date/time: 1REPLY%:%D{%Y}%:%D{%m}%:%D{%d}strftime%Y/%m/%dy/m/dtoday%ustart # && !remaining 12,10: failed to parse relative time: 1 stop = REPLY 0: failed to parse date/time: 1 stop < start datefmtREPLY2datefmtstop0: requested end time is before start time:
  start: REPLY
  end: REPLY2( start + ndays * 24 * 60 * 60 ) # Usage: 0 [ start-date-time stop-date-time ]autoloadmatchdatedonefilenewfile verbose start: datefmtstop:  remaining nonedatefmtmycmdsTMPPREFIX:-/tmp/zsh.calendar_cmds.$zf_ln<<<''mycmdszsh/systemb:zsystemzsystemsupportsflockzsystem/dev/nullzsystemcalendar_lockfilesexitcalendar_readcalendar_entriescalendar_parselinecontinue t = reply[time] restlinereplytext1replywarntime mywarntime = t - reply[warntime] mywarnstrreplywarnstr mywarntime = warntime mywarnstrreplyrpttime repeattime = reply[rpttime]  repeating = 1  repeating = 0  verbose Examining: line  Date/time: datefmtsched  Warning mywarntime seconds (mywarnstr) before shown = 0  brief tmplines(f)lineFtmplines1briefshowlineb\n:space:#\n\nmatch[1]match[3]showline%%:space: showall || (t >= start && (remaining || t <= stop || icount < showcount)) qqshowprogqqshowline icount++  t <= EPOCHSECONDS  shown = 1  tsched = t - mywarntime  tsched >= start && tsched <= stopdue in mywarnstr: showlineqqshowprogqqshowline tsched < start  shown && repeating datefmtrepeattimenewdate:space:restline:space:calendar_addlinesnewdaterestline tcalc = repeattime, resched = 1  tcalc = t  tcalc - mywarntime > EPOCHSECONDS  tsched = tcalc - mywarntime, resched = 1  tsched = tcalc  !shown  resched = 1  resched && (next < 0 || tsched < next)  next = tsched  shown  done != 3  done = 3 Failed to append to donefile done != 3  done = 2 newfile done != 3 Failed to append to newfile done != 3 next(@)zsh_scheduled_events#*:*:Icalendar sqqschedcalendarcalopts[@]No more calendar events: calendar not rescheduled.
Run "calendar -s" again if you add to it.qqshowprogqqshowline done == 2 calendar.oldCouldn't back up calendar to calendar.old.
New calendar left in newfile. rstat = 1 newfileFailed to rename newfile to calendar.
Old calendar left in calendar.old.nobackupnewfilecalendar_addlinescalendar_addnobackup #lockfiles lockfilesrstatAfdқCAF <AC'pA'p5A'p"uA,Cpz,@A$pXA(,L`xAGA Cp@hA pAgpACf۬AA
AfzA0	A.0	bA."x0	;A	F,A
FHaABCۜ .DiA,/AC'pA`
AF$aAFA
F,A
	E	A7	AAۤ	
ACGpT
ABۜu


;
	ApۜA.=A4%1%A?
iA@AC1A.Ar
P
ABx

A.Cr

ACpۜA.FqABIr)IEEApۜ]A.KEA'p(EA|T1A.TrY}A.UAd	CJA4	uIGACA]A1A"44`"f ,fAC&ABFTFA1AgAFAxAj
AT!ABCF$iC&AA}|A.pri
A,q9At1tA.rruAx
AwRA1AN2prr-u	Ax
A!&A"_AA$&XYA,,}A*%AT*A.r
A+A.,A\+
1
A=A,pۜA,A@EA,AFAV2rriA. 	ABri)
EEA.E A,iA21A2F$!A2<!e!A!AC31AC3ۤ!"
A3ۜE"
h"A3pۜ"A.A C6%iA68"AB6F$i6&"A7#A#ALC71A#A7۔%$Ax
A81Af2rI$2`
ri}$A,$A"ruC9&$Ah9AN2pr	%M%riq%A"%:&%Ax
A:۔iAB%C;۔%A;A&A\<
1
A<fjQ&AC<F&A'AB%$=(۔'Al>1A"8(>fj](A>F(A'A")@fk4)A@F%*emulatesetoptextendedgloblocalcontext:datetime:calendar_add:vdatefmt%Y%m%dT%H%M%S[[:digit:]]calendarnewfileREPLYlastlinetextoccurcalendar_entrieslockfilesreplyoccurrencesintegermy_datedonerstatnolocknobackupnew_recurringintegerkeep_my_uidparse_newparse_oldmatchmbeginmendmy_uidtheir_uidautoloadcalendar_parsereadlockfilesgetoptsBLoptnobackupreturnshift( OPTIND - 1 )zstylecontextcalendarfilecalendarcalendar/calendarcalendar.new.HOST.addline*calendar_parseaddlineprint0: failed to parse date/timeparse_new(@kv)reply my_date = parse_new[time] contextreformatdatedatefmtcontextdateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %Ystrftimedatefmtparse_newtimeREPLY parse_new[text1]parse_newrptstr new_recurring = 1 parse_newrptstrCANCELLED done = 1 addlineb:space:#RECURRENCE:space::space::space:vdatefmtparse_newschedrpttimematch[1]REPLYmatch[3]addline\n\nparse_newschedrpttime  # RECURRENCE REPLYuidpat(|*[[:space:]])UID[[:space:]]##(#b)([[:xdigit:]]##)(|[[:space:]]*)addlineuidpatUmatch1 ! nolock zmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendar/dev/nullcalendar_lockfilesexitcalendar_readmy_uidlinecalendar_entrieslinecontinueparse_old(@kv)replyuidpatUmatch1their_uidparse_oldrpttimenew_recurringparse_newtext1:space:#OCCURRENCE:space::space::space:CANCELLED:space:continue new_recurring continueaddlineoccurrencestextb:space:#OCCURRENCE:space::space::space::space::space:occurrencesmatch2match[1] match[3] ! #occurrences my_dateoccurrencesXXXXXXXXTXXXXXX REPLYooccurrencesoccur%%:space:REPLY:digit:c8T:digit:c6b:space:#OCCURRENCE:space:REPLY:space::space::space:match[1]match[2]occurmatch[3]  # OCCURRENCE occuraddlineparse_new(@kv)reply my_date = parse_new[time] contextcontextdatefmtdatefmtcalendar_entriescontinueparse_old(@kv)reply ! done && parse_old[time] > my_date addlinekeep_my_uiduidpatUmatch1continueparse_oldtimemy_dateaddline done continueaddlinenewfile ! nobackup calendar.oldCouldn't back up calendar to calendar.old.
New calendar left in newfile. rstat = 1 addlinenewfile !rstat newfileFailed to rename newfile to calendar.
Old calendar left in calendar.old. #lockfiles lockfilesrstatAg,APxACGAX
AAA(EA\c&CNACFA"rTABCۜHlA$A5A1A"4"f4Tx CfxA&ABCFCFLAf`uA""fk4A"&,	Fdۜlocallinecalendarlockfileseditorintegercal_running # editor@editorVISUAL:EDITOR:vischedreadline calendar -s - - cal_running = 1 zstyle:datetime:calendar:calendarfilecalendarcalendar/calendarzmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendar/dev/nullcalendar_lockfilesexitevaleditor$calendar #lockfiles lockfiles cal_running calendarAC,PA('pEAaA,ACL7LdAt
1
A0bsۜA(A&PAd1A"&c+RiA,Afc+lIAT	1	AlA fLAA`1Af,8AfhۤqACFAP		A$
%AC	fc+lIA.&A
A.(A,)
Ad1A&c+ACfc+lAFA
FAFlocalfilelockfilemsgdoneintegerlockattemptsloadtriedlockfilefile.lockfilei = 0i <= lockattemptsi++ filelockfile/dev/nulllockfilesbreakmsgdonemsgdonelockfile: waiting to acquire lockmsgdone ! loadtried zmodloadzsh/zselect loadtried = 1 zsh/zselectzselect( 10 + RANDOM * 190 / 32768 )sleepmsgdonemsgdone/// msgdonelockfiles1msgdoneFailed to lock file; giving up after lockattempts attempts.
Another instance of calendar may be using it.
Delete lockfiles if you believe this to be an error.msgdoneprintmsgdonereturnAfdқCACF <A'pA0C	'p @lA 	p$A$	8r{XlA
gpAf۬4Ag|<A%AX
	A2AFA
F`ABCf4+CF`A,:}A,;A,<AuA,=	AN1A&HAC]0 ABC۔XFEA,G		A.H!	U	0*	AC
AC4q
۔

A,N
!A,O=yA.R	qA.U0U5
A,Z

A,[A!1A.\r5A,]A,^=tA,_A.`P
AC4۔yA,eA,f9qA.iyqA.l0uA,qMA.s0;A&8ADg1gAF|2`
QA~A,XA,}yAl1AA.yA!AAD!1A!4۔A"&8A0"AaA#&8A,!A,!Al1A9A.!A,AC%A%A%ۜlA,@An1A
A.A(,@=AC(A.qAB(۔X(FAn1AA.		A.=A,AC,F`emulatesetoptextendedgloblocalvdatefmt%Y%m%dT%H%M%SREPLYREPLY2timefmtoccurrenceskiptry_to_recoverbeforeaftermatchmbeginmendintegerthenreplacedfirstschedschedrptoccurrencesautoloadcalendar_scandatetypesetreply # != 1 printUsage: 0 calendar-entryreturnreplytime( REPLY )schedrptreplytimereplytext1REPLY2:space:replytext2replytext1truereplytext2b:space:#RECURRENCE:space::space::space:strftimevdatefmtmatch2format: vdatefmt, string match[2]schedrptthenreplytext2match[1]match[3]##[ 	]#b:space:,WARN:space:asmreplytimematch2replywarntimeREPLYreplywarnstrmatch2%%REPLY2replytext2match[1]REPLY2##[ 	]#replytext2match[1]match[2]##[ 	]#b:space:,RPT:space:beforematch1afterCANCELLED:space:replytext2beforematch[2]##[ 	]#replyrptstrCANCELLEDreplyrpttimeCANCELLEDreplyschedrpttimeCANCELLEDschedrptreplytext2beforeREPLY2##[	]#replyrptstrafter%%REPLY2replytext2beforeafter##[[:space:]]#b:space:#OCCURRENCE:space::space::space::space:occurrencesmatch2match[3]replytext2match[1]match[4]##[ 	]#breakreplyrpttimereplyrptstrCANCELLED now = EPOCHSECONDS replacedreplyschedrpttime schedrpt >= now  reply[schedrpttime] < now || replaced replyschedrpttimereplyrptstr REPLY <= reply[schedrpttime] replyschedrpttime reply[schedrpttime] > now && firstsched == 0 replaced #occurrences timefmtoccurrencestimefmtoccurrencereplacedoccurrencesoccurrenceCANCELLEDoccurrenceformat: vdatefmt, string occurrence then > now && then < reply[rpttime] replyschedrpttimefirstschedreplytext2reply[text2]##[[:space:],]#A(C'+E<AgPAPiA%A<A|C1
A.r!9An1AmA.EAHlocalcalendarlinelinesf<$calendarcalendar_entrieslinesline:space: #calendar_entries calendar_entries1\nlinecalendar_entriesline&A&fdқCAC&F <AB&fpL&FA('A)'`A)'AC*'TqA*gA,*sj{s++#C2KA+'AC-'A-'A.'UA.'A/'!A/'(IA0'"AD04"PdxrCA80gz	,	D	\	x			A 1			A1g
0
\
A2G

A 3

8dA C3A\3$DhE
EBEBEB#A`4A4f
=
zA4C4Km
0
A
0
A
0"A(0jAX0A0A0Ap0A0	;AC>FAC?FA,+AC@<TA)AA,<A,TA	1AHA.uqA.
A1AN2prr	A,iA.q	A,<A,TA.A,	AIG A,( 5A)A.)	
A,*dA,+x!A,,IA"-rq"--A..\
A0A0A,2 aAV3A.3	A,4dA,5x!A"6r
"66<A.7\
A:A:pA,< AV=A.=	A,>dA,?xA"@r!"@@HA.A\
A|D1AD|A,F AG1A.G	A,HdA,Ix!A,JIA.K\
ALN1ANA,O UAP1A.P	A,QdA,Rx!A.S\
AV.-AVHA"YYA,[ A.\!1!A.\	A,]!A,^A,_"IA,`dA,axqA,bA,d\
A,e0
A,f8 A.g, Q A"jx jdA[1Al A,n
!!A,oL!q!Au
1
A~uRr!!Rr!)#r!1$Axu%A.yiA,{%A"|&_F&&A|_1A 'AXC`0$'A,A,A,"IAD8!!((A.0
0$(A,A,,	A,"IAD8!!)(A.0
0$*A,"A,,	A,AD8!!++A.0
0$+A,,	A,"!A,AD8!!`-+A.0
0'-A,"A,,	Aj.ۜ.	/AD8!!@/(A.0
0'e/A,,	A,"!Al.ۜ.0AD8!!0(A.0
0$
1A,"A,A,qAD8!!h22A.0
0$2A,A,"!A,qAD8!!42A.0
0r14ACsg45As'05Q5AD8!!55Atg5A0u%5sj{s++#C2KsA5Ax6ACv.ۜ66	7A" 7h7A7ACw.ۜ.	7Aw.ۜU8	7Aw.ۜ"i8	7A.0
0q}8Ax6Ay<909 A90,:!AP:0*r{"A\\
:
AC|.ۜd:	7A|.ۜx:	7A|.ۜ:	7A}.ۜ.	7A}.ۜU8	7A~.ۜ"i8	7AD8!!:5A.0
Ar1rA;A
1
A;A|1A.r;U<#A.8<A.<A_^A=AXCJ.A	;A\1A=A`>A\1A?Al?AÅ1A@AXÆ
1A.}@A$AÇFqA."EAA$,BA'1A.'B5C%A4hCA.55DqA.8EAP	A"@FA)FF&AÐFAC.ۜ.FA.ۜU8	GAÑ.ۜ"i8AGAIxGA|Ò1AKGAf&GuHA"NIf&-IIAF&UJAt	C-1-AUJA1AVKAC.ۜ.QKA.ۜU8QKAÖ.ۜ"i8QKA.۔KKAD'1'A.^r%L'A"_R_MAA`KAd9MAC.۔KMA.ۜ4U8ANA"idNiNAlOqAnmOA,puPA.q\
AÜ;:A.sr-Q(A"tRtERAXC*1'AuKAwiRAx1AxSAzDSqA|TTA.۔K]UAàAUAtA&UAC.ۜPi8
VA"0V&dVA|VAOqAVA,uPA.\
A<1<AV2rW)rW*A,rCA,	XA,YAd+1+AYA,uPA,\
AYA ZA.ۜ.ZAC.ۜ4U8ZAè.۔KZA.ۜ6	7AT[A"\<\AC.ۜPi8i\A\A$A.r]+A"R	^A-^A,uPA.\
A$A.r^,A"R_A_A,uPA.\
AA`Aö.ۜB:aA.ۜB:aA,bA	1AhbAbQAbAbAcAlcA$A.rc-A"RdAdA,uPA.\
A1A.r}e.AQfA,uPA.\
A1A.rf/AgA,uPA.\
A|C.(APhAþ!1!A|hA`
AhA<1A.h0AÿFAiAgi<iAjA"
j Gi<jjAFACFQA
kAFA`
A`kA<1A.k1ACFACg2kkA1A
kA,2kkA.kElqA,2klA.k=mA .ۜi۔mmA" 
j Gi<n-nAFemulatesetoptextendedglobzmodloadzsh/datetimereturnlocaltschars[-,:[:blank:]]tspat_anchor(tschars#)tspat_noanchor(|*tschars)schars[.,[:space:]]dayarrdayarrdaypatschars#((#B)((j.|.)dayarr)[a-z]#~month*)dspat_anchor(|(#B)(daypat|)(#b)schars#)dspat_anchor_noday(|schars#)dspat_noanchor(|*schars)repat(|s)(|schars*)monthpat(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]#integerdaysecs( 24 * 60 * 60 )[[:digit:]]integeryearyear2monthmonth2day2hourminutesecondthenwdaywday2lineorig_linemnameMATCHMBEGINMENDtestrest_linematchmbeginmendintegerdate_foundtime_foundintegertime_okintegertime_starttime_enddate_startdate_endintegeranchoranchor_enddebugsetvarintegerrelativerelative_startreladdreldaterelsignnewaddgetoptsaAdmrR:stopt anchor = 1  anchor = 1, anchor_end = 1  debug = 1  relsign = -1  relative = 1  relative_start = OPTARG, relative = 2  setvar = 1  time_ok = 1 shift( OPTIND - 1 )dspatdspat_nodaytspat anchor dspat_anchordspat_anchor_noday relative tspat_anchortspat_noanchorlineb\n\nmatch1rest_linematch2dspat_noanchorrestlineibmtspat0-12:0-59.:0-59.-:space:ap.:space:m.:space:erestmatch3match5match7ip hour <= 12  hour += 12  time_found == 0 lineibmtspat0-12:0-59:space:ap.:space:m.:space:ematch4 hour <= 12  hour += 12  time_found == 0 lineibmtspat0-12:space:ap.:space:m.:space:e hour <= 12  hour += 12  time_found == 0 lineibmtspat0-24:0-59.:0-59.-.:space:e time_found == 0 lineibmtspat0-24:0-59.:space:e time_found == 0  anchor tspat_anchorlineibmtspat""":ddddddddTdddddd:space:ematch6match8mbegin3date_endmend1 hour == 24  time_found && ! date_found mbegin2time_endmend1linetime_end+1,1b:space:AZAZAZ+09090909:space:eb:space:AZAZAZ+0-12:space:eb:space:AZAZAZ+0-12AZAZAZ:space:e time_end += mend[-1] line1,time_start1linetime_end+1,1 debug printline after time: line relative == 0 && date_found == 0 bidspat19200909/1-12/1-31date_endmend5bidspat19200909/monthpat/1-31date_endbidspat1-31thstndrd:space:monthpat,:space:19200909date_endmend6bidspatmonthpat:space:1-31thstndrd,:space:19200909date_endbidspat1-31thstndrd:space:monthpat,:space:strftime%YEPOCHSECONDSdate_endbidspatmonthpat:space:1-31thstndrd,:space:EPOCHSECONDSdate_endbidspat1-31thstndrd/1-12,:space:/19200909date_endmend7bidspat1-12/1-31thstndrd,:space:/19200909date_endbidspat_nodaydaypatscharsintegerwday_nowwdaystrLmatch3date_endmend2wdays wday = wdays[(i)wdaystr] - 1  then = EPOCHSECONDS wday_now%wthen wday_now < wday  wday_now += 7  then -= (wday_now - wday) * 24 * 60 * 60 %m%dbidspat_nodayyesterdaytodaytomorrownowscharsLmatch2yesterday then -= daysecs tomorrow then += daysecs time_end%H%M%Sdate_end date_found || (time_ok && time_found)  date_found line1,date_start1bidaypatscharsmbegin1line1,date_start1linedate_end+1,1 time_found == 1  time_start <= date_start  date_start += time_end - time_start + 1  time_start <= date_end  date_end += time_end - time_start + 1  time_end + 1 < date_start orig_linetime_end+1,date_start1scharsorig_line[1,time_start-1]orig_line[date_end+1,-1] date_end + 1 < time_start orig_linedate_end+1,time_start1tschars time_found = 0, hour = 0, minute = 0, second = 0 orig_line[1,date_start-1]orig_line[date_end+1,-1]orig_line[1,date_start-1]orig_line[time_end+1,-1] anchor orig_line1,time_start1tscharsEPOCHSECONDSEPOCHSECONDSEPOCHSECONDS date_found = 1  debug Time string: time_start,time_end:'orig_line[time_start,time_end]' date_ok Date string: date_start,date_end:'orig_line[date_start,date_end]'Remaining line: 'linerest_line' relative  relative == 2 relative_start%Y:%m:%dyear:month:daybidspat-:space:yyryearyearlyrepatmatch2 year2 = year + relsign * match[2] year2:month:dayreldate month2 != month  reldate -= daysecs  reladd += reldate - then  reladd += relsign * ((365*4+1) * daysecs * match[2] + 1) / 4 line1,mbegin21linemend4+1,1bidspat-:space:mthmonmnthmonthmonthlyrepatmatch2 month2 = month + relsign * match[2]  month2 <= 0  year2 = year + month2 / 12 - 1, month2 = month2 + (year-year2)*12  year2 = year + (month2 - 1)/ 12, month2 = (month2 - 1) % 12 + 1 year2:month2:day day > 28 truereldate day2 >= 28 break reldate -= daysecs  reladd += relsign * 30 * daysecs * match[2] relativebidspat_noday-thrdndstdaypatscharsLmatch4schars%%schars1,3dayarrItest wday  wday--  reldate = relative_start + reladd reldatereldateyear2:month2:1 day = 1 + (wday - wday2) + (nth - 1) * 7  wday < wday2  day += 7 reldate newadd += (day - day2) * daysecs bidspat-:space:wwkweekweeklyrepatmatch2 newadd += relsign * 7 * daysecs * match[2] bidspat-:space:ddydaydailyrepatmatch2 newadd += relsign * daysecs * match[2]  relative == 2 && newadd ( relative_start + reladd )( relative_start + reladd + newadd ) hd = h2 - h1  hd > 12  hd -= 24  hd < -12  hd += 24  newadd -= hd * 3600  reladd += newadd bidspat-:space:hhrhourhourlyrepatmatch2 reladd += relsign * 60 * 60 * match[2] bidspat-:space:minminuterepat reladd += relsign * 60 * match[2] bidspat-:space:ssecsecondrepat reladd += relsign * match[2]  relative  time_found  anchor_end schars reladd += (hour * 60 + minute) * 60 + second typesetREPLY REPLY = relative_start + reladd  setvarREPLY2linerest_line date_found == 0  anchor_end scharsnumsmname%Y %b %d %H %M %Syear mname day hour minute second%Y %m %d %H %M %Syear month day hour minute secondfmtnumsREPLY2linerest_lineA(' +8+AFLA"
c+CFc+LAfd۔}Agk#ABCfLC&AH('A>2P
!rEaA|CA62@
y
AC%k#1QA
UA%k#AA"
=F`F,AA(CCF}AC	Fintegerstartstopshiftprint*localzmodloadzsh/parameterreturnDISPLAYstartstopcommandskdialogKDE_SESSION_UIDkdialogmsgboxcommandsxmessagexmessagecentercmd1uUIDgrepcmd1/dev/nullcmdAfdқCAF <AfpLAzAg4HABClۜ4
TuA A~Rr+۔Rr+r+4;ACl+0۔A&A,A.40G4;AC A.r+
A, AA&AC&Al1AFR`R++;,9AFd}AF,A,"H+A&0
A
&AC
&hAB.GAX
	A0ACFdAF,AC
A5-A,6A7A.7r+AA"9r+<	9lA,:YA=1A=A,>A.?AACAB @۔+F,A.EqABf@+F,A&A"MC&,Afemulatesetoptextendedglobzmodloadzsh/datetimelocaloptmdatefmtintegeroptrreplysetzstyle:datetime:calendar_showdate:dateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %YshiftREPLYfdatefmt13,1print0: -f requires a date/time specificationreturndatefmtbreak optr  ! # Usage: 0 datespec [ ... ] # +12,1 ! replyset EPOCHSECONDSreplyset replyset calendar_scandateoptmREPLYreplysetstrftimedatefmtAfdқCAF <ACfp۬A$ 8\pr+Ag A(C <xAGJABCۜi
APH"A8! AA"48d"fCf	A&ABCF0	CF|A,r+ACF	AT	1	A^Rr
2Pr
RaAFA\Ad	1A	faAC	<yA	aA8
A+AlA
iA0,\)	ACF|		A"3	f|	d-
A
A&6r
A
F|	
AFQA9
AF|	IAFAX
	Afj	AF|	!
AFAX
	Afj
	ACF|	EAFAF|	iA"Lfk۔3=emulatesetoptextendedglobautoloadcalendar_readscandatelockfileslocalcalendarlineREPLYlockfilecalendar_entriestimeslines_sortedlines_unsortedlines_failedlockfilesintegerzstyle:datetime:calendar:calendarfilecalendarcalendar/calendarzmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendarcalendar_lockfilesexitcalendar.new.calendar_readcalendar_entriescalendar_entries1returncalendar_entriescalendar_scandateline(l.16..0.)REPLY:linelines_failed #lines_unsorted lines_sortedolines_unsorted09:lines_failed[@]printline # BAD DATE #lines_sorted lines_sorted[@]newWriting to new failed. #lines_failed Warning: lines with date that couldn't be parsed.
Output (with unparseable dates marked) left in newcalendar.oldCouldn't back-up calendar to calendar.old.
New calendar left in newFailed to rename new to calendar.
Old calendar left in calendar.oldOld calendar left in calendar.old #lockfiles lockfilesh5.8t
Lfunctions/Calendar/afterxLfunctions/Calendar/aget
Lfunctions/Calendar/before.
Lfunctions/Calendar/calendarULfunctions/Calendar/calendar_addZLfunctions/Calendar/calendar_editLfunctions/Calendar/calendar_lockfilesgLfunctions/Calendar/calendar_parse,Lfunctions/Calendar/calendar_readBa2&Lfunctions/Calendar/calendar_scandate.+DLfunctions/Calendar/calendar_show./e6
lLfunctions/Calendar/calendar_showdate/13	Lfunctions/Calendar/calendar_sort1AfdCA 4DhACf LAfҬACG,DA,dkAB yFA BCdyCFAA#A	1.A$r+9,A%-A(B	k4}	FA	',A
C',+A4C'4MEpEAg,ACACf,A2pyA
$+0A60PA:l0;AFAFqAFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # == 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt1:AGEREFtmp1AGEREFintegermtimevals1date1date2REPLYREPLY2AGEREFafter mtime >= date1 before mtime < date1 print0: must be named 'after' or 'before'AfdCA 4DhACf LAfҬA	CG,DA	,dkAB(y
FA B
Cdy
CFA
<;A+A .A,r+9A-	1A-
.A.0Qq.A0A(Bk4FA',,IA
C',h+A1.A8r+9A(BCk4QCFA',IA',+A4'EE4ACg,LdA\*&Af,AEyA1AG
A1.AHr9[ABCfCFAJ$	qABfF.AM4yqAPAS$qACFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # >= 1  # > 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt%Y/%m/%dtimefmt1:AGEREFtmp1AGEREF2:AGEREF2integermtimevals1date1date2REPLYREPLY2AGEREFAGEREF2AGEREF2AGEREF22,1 date2 = date1 + REPLY AGEREF2 date2 = date1 + 24 * 60 * 60  date1 <= mtime && mtime <= date2 AfdCA 4DhACf LAfҬACG,DA,dkAB yFA BCdyCFAA#A	1.A$r+9,A%-A(B	k4}	FA	',A
C',+A4C'4MEpEAg,ACACf,A2pyA
$+0A60PA:l0;AFAFqAFemulatezmodloadzsh/statb:zstatzsh/parameterautoloadcalendar_scandatelocaltimefmtvalsREPLYreturnzstat+mtime # == 1 timefmt%Y/%m/%d:%H:%M:%Stimefmt1:AGEREFtmp1AGEREFintegermtimevals1date1date2REPLYREPLY2AGEREFafter mtime >= date1 before mtime < date1 print0: must be named 'after' or 'before'AfdCAF <A0C'p<`A,p HA`'hj"EE$E8A4GTtJ0A,CXx0PAphA4Gp,PxAgpABfL FTABfLpFTAB4FTAfҬABC	A	x		,A	AB
I


ABCU,,ABC
eAB
A
p 

AA"
A1.A#rlA$<
QA	CfA	F,A(%A)HqA+AB/FTA
',A
Cpz@`A
MN.A7r}<A8,A9z,A:@%A"";`RRuru&A<CNA<
uACu0A1AB
,AC`.AD@QAE,AF`.AG@qA CfIAFTAx\u"0,AOPA\

1APA CfAAFT	0.AX"0r,A]$A\

1A^LA fAFT
0A,Q0
Aq0	Av0"
A{0"A$0AX
0
,AA	0.At	0l.Au0;A&FA'FT,AzE.A@uA(A)F!ABPA*3$AA*1.Ar+{r.AIQ.Ar+l.A+Ad,1A,f+A,CFA,FT.AA-&q\A-jq"A .I.AuA/#A0\G1AAd0C+.Ar+9[Al01A0
A0F9A1FTAQ.Ar+l.A+Ad21A2f+A2FA3FT.AA4AA4CA4!EA4F]A5FTA6&qA#+	0.A	0.A	0;.A.A AX;
	A!%A;F!9A<FTA<f!Ҭ"A"
"A=Cfk4"iA=1A"A>ft"A>Cf"A>ft#AT>	1A#$A?F#UA?f#qEA@'p##AB@$Xs4$q$@FTA"A\AlBC[5YABA

"AACA"C4$$"Cf%%(%L "C%f%d%L D%f%%L"AAD&qABEf%"AEF&AFF&,ApFC,&eABFF&&F&'A'%,A!'x'A#
1A#
'A$(!.A%((qA')(.A()A+	1A+
)A-)A.*|qA0*AMA4*AMCF+%AMft+qAMf++A4N1A8
+ANCF+A<,AlOCA=,AO--5.A?-iq.AA&AP%xtAE.AEr-.	.AF.,AI/!ADR'AJ/A0SD$0E0AM18A"O1dO1QAP
+AQ1AT1AR2L,AS2A0UD$3]E3QAU3AX1AV10A[
+AWA\4 AWH4u4A_	VA_2445!5I.A`EHAX5|5Ah6qAj6Am1Am6Ao7\Ar8A"t8Lt8p^Av1Av8Aw9LA^551Az
"AA^11A{9A_C1A!_CD"Af&AP_	A~9A9A`F:	QA:A:qAa1A!aD:f&APb	A;A9AbF;9QA;A:A4d%%1A
+Ae!1&A;,AJ;A|eD$IA"IffL,A,fC&<;==-;;
q,A=mA0gD$>E?1Ah"1A?pAh
1Ahfj?AiF?AA
QAifjAAAjFAeAA.ABA
"AAkfk4BA8l,BAlC0dCe&A"Cmfk4CAnCF&CTniA"r$oFr$AoCfk4$emulatesetoptextendedgloblocallineshowlinerestlineREPLYREPLY2userangenobackupdatefmtcalendardonefileschednewfilewarnstrmywarnstrnewdateintegertimestartstoptodayndaysnextshowndonenodoneintegerverbosewarntimemywarntimetcalctschedrstatremainingintegershowcounticountrepeatingrepeattimereschedshowallbriefcalendar_entriescalendar_addlinestimescaloptsshowproglockfilesmatchmbeginmendtmplinesreplyzmodloadzsh/datetimereturnzsh/zutilzsh/filesb:zf_lnautoloadcalendar_addparsereadscandateshowlockfileszstyle:datetime:calendar:calendarfilecalendarcalendar/calendarcalendar.new.HOST.:datetime:calendar:donefiledonefiledonefilecalendar.done:datetime:calendar:showprogcalendar_show:datetime:calendar:warntimewarnstrwarnstr0:05:datetime:calendar:dateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %Ywarnstr warntime = warnstr calendar_scandateprintwarn-time value 'warnstr' not understood; using default 5 minuteswarnstr5 mins warntime = 5 * 60  warntime = REPLY calendarintegeroptioptrestoptargargvopti+1 opti++ argvopti2argvopti3,1optbreakBCnSoptrest opti < # argv++opti0: option -opt requires an argument.optarg brief <= 0 0: option -opt requires a positive integer.calendarshowcount showcount <= 0 0: option -opt requires a positive integer.s.:.optarg showall = 1  brief = 1  done = 1  nodone = 1  remaining = 1 showcount0: unrecognised option: -optoptrest1optrest2,1caloptsargv1,optishift( opti ) done && !nodone donefile # > 1 || (# == 1 && remaining) EPOCHSECONDS0: failed to parse date/time: 1REPLY%:%D{%Y}%:%D{%m}%:%D{%d}strftime%Y/%m/%dy/m/dtoday%ustart # && !remaining 12,10: failed to parse relative time: 1 stop = REPLY 0: failed to parse date/time: 1 stop < start datefmtREPLY2datefmtstop0: requested end time is before start time:
  start: REPLY
  end: REPLY2( start + ndays * 24 * 60 * 60 ) # Usage: 0 [ start-date-time stop-date-time ]autoloadmatchdatedonefilenewfile verbose start: datefmtstop:  remaining nonedatefmtmycmdsTMPPREFIX:-/tmp/zsh.calendar_cmds.$zf_ln<<<''mycmdszsh/systemb:zsystemzsystemsupportsflockzsystem/dev/nullzsystemcalendar_lockfilesexitcalendar_readcalendar_entriescalendar_parselinecontinue t = reply[time] restlinereplytext1replywarntime mywarntime = t - reply[warntime] mywarnstrreplywarnstr mywarntime = warntime mywarnstrreplyrpttime repeattime = reply[rpttime]  repeating = 1  repeating = 0  verbose Examining: line  Date/time: datefmtsched  Warning mywarntime seconds (mywarnstr) before shown = 0  brief tmplines(f)lineFtmplines1briefshowlineb\n:space:#\n\nmatch[1]match[3]showline%%:space: showall || (t >= start && (remaining || t <= stop || icount < showcount)) qqshowprogqqshowline icount++  t <= EPOCHSECONDS  shown = 1  tsched = t - mywarntime  tsched >= start && tsched <= stopdue in mywarnstr: showlineqqshowprogqqshowline tsched < start  shown && repeating datefmtrepeattimenewdate:space:restline:space:calendar_addlinesnewdaterestline tcalc = repeattime, resched = 1  tcalc = t  tcalc - mywarntime > EPOCHSECONDS  tsched = tcalc - mywarntime, resched = 1  tsched = tcalc  !shown  resched = 1  resched && (next < 0 || tsched < next)  next = tsched  shown  done != 3  done = 3 Failed to append to donefile done != 3  done = 2 newfile done != 3 Failed to append to newfile done != 3 next(@)zsh_scheduled_events#*:*:Icalendar sqqschedcalendarcalopts[@]No more calendar events: calendar not rescheduled.
Run "calendar -s" again if you add to it.qqshowprogqqshowline done == 2 calendar.oldCouldn't back up calendar to calendar.old.
New calendar left in newfile. rstat = 1 newfileFailed to rename newfile to calendar.
Old calendar left in calendar.old.nobackupnewfilecalendar_addlinescalendar_addnobackup #lockfiles lockfilesrstatAfdCAF <AC'pA'p5A'p"uA,Cpz,@A$pXA(,L`xAGA Cp@hA pAgpACfҬAA
AfzA	0.A	0b.A"x	0;A	F,A
FHaABC .Di,A/AC'pA`
AF$aAFA
F,A
		EA7	AA	
ACGp
TAB
u

;
	Ap.A=A4%%1A?
iA@AC1.AAr

PAB
x
.ACr

ACp.AFqABIr)IEEAp].AKEA'p(E|AT1.ATrY}.AUA	dCJA	4IuGACA]A1A"44`"f ,fAC&ABFTFA1AgAFAxAj
AT!ABCF$iC&AA}|.Apri
,Aq9Att1.ArruAx
AwRA1NAp2rr-u	A
xA!&A"_AA$&XY,A,}A*%AT*.Ar
A+.A,A\+

1A=A,pA,A@E,AFAVA2rri.A 	ABri)
EE.AE ,AiA21A2F$!A2!<!eA!A3C1A3C"!
A3"E
"hA3p".AA 6C%iA68"AB6F$i6&"A7##AAL7C1A#A7$%A
xA81fA2r$I`2
ri$},A$A"ru9C&$Ah9NAp2r%	%Mri%qA"%:&%A
xA:iAB%;C%A;A&A\<

1A<fj&QA<CF&A'AB%$=('Al>1A"(8>fj(]A>F(A'A")@fk4)A@F*%emulatesetoptextendedgloblocalcontext:datetime:calendar_add:vdatefmt%Y%m%dT%H%M%S[[:digit:]]calendarnewfileREPLYlastlinetextoccurcalendar_entrieslockfilesreplyoccurrencesintegermy_datedonerstatnolocknobackupnew_recurringintegerkeep_my_uidparse_newparse_oldmatchmbeginmendmy_uidtheir_uidautoloadcalendar_parsereadlockfilesgetoptsBLoptnobackupreturnshift( OPTIND - 1 )zstylecontextcalendarfilecalendarcalendar/calendarcalendar.new.HOST.addline*calendar_parseaddlineprint0: failed to parse date/timeparse_new(@kv)reply my_date = parse_new[time] contextreformatdatedatefmtcontextdateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %Ystrftimedatefmtparse_newtimeREPLY parse_new[text1]parse_newrptstr new_recurring = 1 parse_newrptstrCANCELLED done = 1 addlineb:space:#RECURRENCE:space::space::space:vdatefmtparse_newschedrpttimematch[1]REPLYmatch[3]addline\n\nparse_newschedrpttime  # RECURRENCE REPLYuidpat(|*[[:space:]])UID[[:space:]]##(#b)([[:xdigit:]]##)(|[[:space:]]*)addlineuidpatUmatch1 ! nolock zmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendar/dev/nullcalendar_lockfilesexitcalendar_readmy_uidlinecalendar_entrieslinecontinueparse_old(@kv)replyuidpatUmatch1their_uidparse_oldrpttimenew_recurringparse_newtext1:space:#OCCURRENCE:space::space::space:CANCELLED:space:continue new_recurring continueaddlineoccurrencestextb:space:#OCCURRENCE:space::space::space::space::space:occurrencesmatch2match[1] match[3] ! #occurrences my_dateoccurrencesXXXXXXXXTXXXXXX REPLYooccurrencesoccur%%:space:REPLY:digit:c8T:digit:c6b:space:#OCCURRENCE:space:REPLY:space::space::space:match[1]match[2]occurmatch[3]  # OCCURRENCE occuraddlineparse_new(@kv)reply my_date = parse_new[time] contextcontextdatefmtdatefmtcalendar_entriescontinueparse_old(@kv)reply ! done && parse_old[time] > my_date addlinekeep_my_uiduidpatUmatch1continueparse_oldtimemy_dateaddline done continueaddlinenewfile ! nobackup calendar.oldCouldn't back up calendar to calendar.old.
New calendar left in newfile. rstat = 1 addlinenewfile !rstat newfileFailed to rename newfile to calendar.
Old calendar left in calendar.old. #lockfiles lockfilesrstatAg,APxACGAX
AAA(EA\c&CNACFA"rTABCHlA$A5A1A"4"f4Tx CfxA&ABCFCFLAf`uA""fk4A"&,	Fdlocallinecalendarlockfileseditorintegercal_running # editor@editorVISUAL:EDITOR:vischedreadline calendar -s - - cal_running = 1 zstyle:datetime:calendar:calendarfilecalendarcalendar/calendarzmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendar/dev/nullcalendar_lockfilesexitevaleditor$calendar #lockfiles lockfiles cal_running calendarAC,PA('pEAa,AAC7LLdAt

1A0sbA(A&PAd1A"&+cRi,AAf+clIAT		1AlA fLAA`1Af,8AfhqACFAP		A$
%A	Cf+clI.A&A
.A(,A)
Ad1A&+cACf+clAFA
FAFlocalfilelockfilemsgdoneintegerlockattemptsloadtriedlockfilefile.lockfilei = 0i <= lockattemptsi++ filelockfile/dev/nulllockfilesbreakmsgdonemsgdonelockfile: waiting to acquire lockmsgdone ! loadtried zmodloadzsh/zselect loadtried = 1 zsh/zselectzselect( 10 + RANDOM * 190 / 32768 )sleepmsgdonemsgdone/// msgdonelockfiles1msgdoneFailed to lock file; giving up after lockattempts attempts.
Another instance of calendar may be using it.
Delete lockfiles if you believe this to be an error.msgdoneprintmsgdonereturnAfdCACF <A'pA0	C'p @lA 	p$A$	8{rXlA
gpAfҬ4Ag|<A%AX
	A2AFA
F`ABCf4+CF`,A:},A;,A<Au,A=	A1NA&HAC] 0ABCXFE,AG		.AH	!	U*0	AC
AC4
q

,AN
!,AO=y.AR	q.AUU0
5,AZ

,A[A!1.A\r5,A],A^=t,A_.A`P
AC4y,Ae,Af9q.Aiyq.Al0u,AqM.As0;A&8ADgg1FA|`2
QA~,AX,A}ylA1A.AyA!AAD!1A!4A"&8A0"AaA#&8,A!,A!lA1A9.A!,AA%CA%A%l,A@nA1A
.AA(,@=A(C.AqAB(X(FnA1A.A		.A=,AA,CF`emulatesetoptextendedgloblocalvdatefmt%Y%m%dT%H%M%SREPLYREPLY2timefmtoccurrenceskiptry_to_recoverbeforeaftermatchmbeginmendintegerthenreplacedfirstschedschedrptoccurrencesautoloadcalendar_scandatetypesetreply # != 1 printUsage: 0 calendar-entryreturnreplytime( REPLY )schedrptreplytimereplytext1REPLY2:space:replytext2replytext1truereplytext2b:space:#RECURRENCE:space::space::space:strftimevdatefmtmatch2format: vdatefmt, string match[2]schedrptthenreplytext2match[1]match[3]##[ 	]#b:space:,WARN:space:asmreplytimematch2replywarntimeREPLYreplywarnstrmatch2%%REPLY2replytext2match[1]REPLY2##[ 	]#replytext2match[1]match[2]##[ 	]#b:space:,RPT:space:beforematch1afterCANCELLED:space:replytext2beforematch[2]##[ 	]#replyrptstrCANCELLEDreplyrpttimeCANCELLEDreplyschedrpttimeCANCELLEDschedrptreplytext2beforeREPLY2##[	]#replyrptstrafter%%REPLY2replytext2beforeafter##[[:space:]]#b:space:#OCCURRENCE:space::space::space::space:occurrencesmatch2match[3]replytext2match[1]match[4]##[ 	]#breakreplyrpttimereplyrptstrCANCELLED now = EPOCHSECONDS replacedreplyschedrpttime schedrpt >= now  reply[schedrpttime] < now || replaced replyschedrpttimereplyrptstr REPLY <= reply[schedrpttime] replyschedrpttime reply[schedrpttime] > now && firstsched == 0 replaced #occurrences timefmtoccurrencestimefmtoccurrencereplacedoccurrencesoccurrenceCANCELLEDoccurrenceformat: vdatefmt, string occurrence then > now && then < reply[rpttime] replyschedrpttimefirstschedreplytext2reply[text2]##[[:space:],]#A(C'+E<AgPAPiA%A<A|C
1.Ar!9nA1Am.AEAHlocalcalendarlinelinesf<$calendarcalendar_entrieslinesline:space: #calendar_entries calendar_entries1\nlinecalendar_entriesline&A&fdCA&CF <AB&fpL&FA('A)'`A)'A*C'TqA*gA,*ss{j+#+CK2A+'A-C'A-'A.'UA.'A/'!A/'(IA0'"AD04"PdxCrA80gz		,	D	\	xӢ		A 1			A1g

0
\A2G

A 3

8dA 3CA\3$DhE
EBEBE#BA`4A4f

=zA44CK
m0
A
0
A
0"A(0jAX0A0A0Ap0A	0;A>CFA?CF,A+A@C<TA)A,A<,ATA	1AH.Auq.A
A1NAp2rr	,Ai.A	q,A<,AT.A,A	AIG ,A( 5A).A)	
,A*d,A+x!,A,IA"-rq"--.A.
\A0A0,A2 aVA3.A3	,A4d,A5x!A"6r
"66<.A7
\A:A:p,A< VA=.A=	,A>d,A?xA"@r!"@@H.AA
\|AD1AD|,AF AG1.AG	,AHd,AIx!,AJI.AK
\LAN1AN,AO UAP1.AP	,AQd,ARx!.AS
\AV.-AVHA"YY,A[ .A\!!1.A\	,A]!,A^,A_"I,A`d,Aaxq,Ab,Ad
\,Ae
0,Af8 .Ag , QA"j xjdA[1Al ,An
!!,Ao!L!qAu

1~AuRr!!Rr!#)r!$1Ax%u.AyӢi,A{%A"|&_F&&A|_1A' AX`C$0',A,A,A"IDA8!!((.A
0$0(,A,A	,,A"IDA8!!)(.A
0$0*,A",A	,,ADA8!!++.A
0$0+,A	,,A"!,ADA8!!-`+.A
0'0-,A",A	,Aj../	DA8!!/@(.A
0'0/e,A	,,A"!Al..0DA8!!0(.A
0$01
,A",A,AqDA8!!2h2.A
0$02,A,A"!,AqDA8!!42.A
0r041AsCg45As'505QDA8!!55Atg5A0u%5ss{j+#+CK2sA5A6xAvC.667	A"7 7hA7AwC..7	Aw.8U7	Aw."8i7	.A
0q08}A6xAy<909 A90:,!A:P*0{r"\A
\:
A|C.d:7	A|.x:7	A|.:7	A}..7	A}.8U7	A~."8i7	DA8!!:5.A
0Arr1A;A

1A;|A1.Ar;<U#.A8<.A<A_^A=AXCJ.A	;\A1A=A>`\A1A?A?lA1A@AX
1.A@}A$AFq.A"AEA$B,A'1.A'BC5%A4Ch.A5D5q.A8EAP	A"@FAF)F&AFAC..FA.8UG	A."8iGAAIGxA|1AKGAf&GHuA"NIf&I-IAF&JUA	tC--1AUJA1AVKAC..KQA.8UKQA."8iKQA.KKAD''1.A^rL%'A"_R_MAA`KAdM9AC.KMA.48UNAA"iNdiNAlOqAnOm,ApPu.Aq
\A;:.AsrQ-(A"tRtREAXC*'1AuKAwRiAx1AxSAzSDqA|TTA.KU]AAUAtA&UAC.P8iV
A"V0&VdAV|AOqAV,APu.A
\A<<1VA2rW)rW*,ACr,A	X,AYAd++1AY,APu,A
\AYAZ A..ZAC.48UZA.KZA.67	A[TA"\\<AC.P8i\iA\$A.Ar]+A"R^	A^-,APu.A
\$A.Ar^,A"R_A_,APu.A
\AA`A.B:aA.B:aAb,A	1AbhAbQAbAbAcAcl$A.Arc-A"RdAd,APu.A
\A1.Are}.AfQ,APu.A
\A1.Arf/Ag,APu.A
\A|C.(AhPA!!1Ah|A`
AhA<1.Ah0AFAiAgi<iAjA"
j Gi<jjAFACFQA
kAFA`Ã
Ak`A<1.Ak1ACFACgk2kA1A
k,Ak2k.AklEq,Ak2l.Akm=A ǃ.immA" 
j Gi<nn-AȃFemulatesetoptextendedglobzmodloadzsh/datetimereturnlocaltschars[-,:[:blank:]]tspat_anchor(tschars#)tspat_noanchor(|*tschars)schars[.,[:space:]]dayarrdayarrdaypatschars#((#B)((j.|.)dayarr)[a-z]#~month*)dspat_anchor(|(#B)(daypat|)(#b)schars#)dspat_anchor_noday(|schars#)dspat_noanchor(|*schars)repat(|s)(|schars*)monthpat(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[a-z]#integerdaysecs( 24 * 60 * 60 )[[:digit:]]integeryearyear2monthmonth2day2hourminutesecondthenwdaywday2lineorig_linemnameMATCHMBEGINMENDtestrest_linematchmbeginmendintegerdate_foundtime_foundintegertime_okintegertime_starttime_enddate_startdate_endintegeranchoranchor_enddebugsetvarintegerrelativerelative_startreladdreldaterelsignnewaddgetoptsaAdmrR:stopt anchor = 1  anchor = 1, anchor_end = 1  debug = 1  relsign = -1  relative = 1  relative_start = OPTARG, relative = 2  setvar = 1  time_ok = 1 shift( OPTIND - 1 )dspatdspat_nodaytspat anchor dspat_anchordspat_anchor_noday relative tspat_anchortspat_noanchorlineb\n\nmatch1rest_linematch2dspat_noanchorrestlineibmtspat0-12:0-59.:0-59.-:space:ap.:space:m.:space:erestmatch3match5match7ip hour <= 12  hour += 12  time_found == 0 lineibmtspat0-12:0-59:space:ap.:space:m.:space:ematch4 hour <= 12  hour += 12  time_found == 0 lineibmtspat0-12:space:ap.:space:m.:space:e hour <= 12  hour += 12  time_found == 0 lineibmtspat0-24:0-59.:0-59.-.:space:e time_found == 0 lineibmtspat0-24:0-59.:space:e time_found == 0  anchor tspat_anchorlineibmtspat""":ddddddddTdddddd:space:ematch6match8mbegin3date_endmend1 hour == 24  time_found && ! date_found mbegin2time_endmend1linetime_end+1,1b:space:AZAZAZ+09090909:space:eb:space:AZAZAZ+0-12:space:eb:space:AZAZAZ+0-12AZAZAZ:space:e time_end += mend[-1] line1,time_start1linetime_end+1,1 debug printline after time: line relative == 0 && date_found == 0 bidspat19200909/1-12/1-31date_endmend5bidspat19200909/monthpat/1-31date_endbidspat1-31thstndrd:space:monthpat,:space:19200909date_endmend6bidspatmonthpat:space:1-31thstndrd,:space:19200909date_endbidspat1-31thstndrd:space:monthpat,:space:strftime%YEPOCHSECONDSdate_endbidspatmonthpat:space:1-31thstndrd,:space:EPOCHSECONDSdate_endbidspat1-31thstndrd/1-12,:space:/19200909date_endmend7bidspat1-12/1-31thstndrd,:space:/19200909date_endbidspat_nodaydaypatscharsintegerwday_nowwdaystrLmatch3date_endmend2wdays wday = wdays[(i)wdaystr] - 1  then = EPOCHSECONDS wday_now%wthen wday_now < wday  wday_now += 7  then -= (wday_now - wday) * 24 * 60 * 60 %m%dbidspat_nodayyesterdaytodaytomorrownowscharsLmatch2yesterday then -= daysecs tomorrow then += daysecs time_end%H%M%Sdate_end date_found || (time_ok && time_found)  date_found line1,date_start1bidaypatscharsmbegin1line1,date_start1linedate_end+1,1 time_found == 1  time_start <= date_start  date_start += time_end - time_start + 1  time_start <= date_end  date_end += time_end - time_start + 1  time_end + 1 < date_start orig_linetime_end+1,date_start1scharsorig_line[1,time_start-1]orig_line[date_end+1,-1] date_end + 1 < time_start orig_linedate_end+1,time_start1tschars time_found = 0, hour = 0, minute = 0, second = 0 orig_line[1,date_start-1]orig_line[date_end+1,-1]orig_line[1,date_start-1]orig_line[time_end+1,-1] anchor orig_line1,time_start1tscharsEPOCHSECONDSEPOCHSECONDSEPOCHSECONDS date_found = 1  debug Time string: time_start,time_end:'orig_line[time_start,time_end]' date_ok Date string: date_start,date_end:'orig_line[date_start,date_end]'Remaining line: 'linerest_line' relative  relative == 2 relative_start%Y:%m:%dyear:month:daybidspat-:space:yyryearyearlyrepatmatch2 year2 = year + relsign * match[2] year2:month:dayreldate month2 != month  reldate -= daysecs  reladd += reldate - then  reladd += relsign * ((365*4+1) * daysecs * match[2] + 1) / 4 line1,mbegin21linemend4+1,1bidspat-:space:mthmonmnthmonthmonthlyrepatmatch2 month2 = month + relsign * match[2]  month2 <= 0  year2 = year + month2 / 12 - 1, month2 = month2 + (year-year2)*12  year2 = year + (month2 - 1)/ 12, month2 = (month2 - 1) % 12 + 1 year2:month2:day day > 28 truereldate day2 >= 28 break reldate -= daysecs  reladd += relsign * 30 * daysecs * match[2] relativebidspat_noday-thrdndstdaypatscharsLmatch4schars%%schars1,3dayarrItest wday  wday--  reldate = relative_start + reladd reldatereldateyear2:month2:1 day = 1 + (wday - wday2) + (nth - 1) * 7  wday < wday2  day += 7 reldate newadd += (day - day2) * daysecs bidspat-:space:wwkweekweeklyrepatmatch2 newadd += relsign * 7 * daysecs * match[2] bidspat-:space:ddydaydailyrepatmatch2 newadd += relsign * daysecs * match[2]  relative == 2 && newadd ( relative_start + reladd )( relative_start + reladd + newadd ) hd = h2 - h1  hd > 12  hd -= 24  hd < -12  hd += 24  newadd -= hd * 3600  reladd += newadd bidspat-:space:hhrhourhourlyrepatmatch2 reladd += relsign * 60 * 60 * match[2] bidspat-:space:minminuterepat reladd += relsign * 60 * match[2] bidspat-:space:ssecsecondrepat reladd += relsign * match[2]  relative  time_found  anchor_end schars reladd += (hour * 60 + minute) * 60 + second typesetREPLY REPLY = relative_start + reladd  setvarREPLY2linerest_line date_found == 0  anchor_end scharsnumsmname%Y %b %d %H %M %Syear mname day hour minute second%Y %m %d %H %M %Syear month day hour minute secondfmtnumsREPLY2linerest_lineA(' +8+AFLA"
+cCF+cLAfd}Ag#kABCfLC&AH('>AP2
!rEaA|C6A@2
y
AC%#k1QA
UA%#kAA"
=F`F,AA(CCF}A	CFintegerstartstopshiftprint*localzmodloadzsh/parameterreturnDISPLAYstartstopcommandskdialogKDE_SESSION_UIDkdialogmsgboxcommandsxmessagexmessagecentercmd1uUIDgrepcmd1/dev/nullcmdAfdCAF <AfpLAzAg4HABCl4
TuA ~ARr+Rr+r+;4ACl+0A&,A.A4G0;4AC .Ar+
,A AA&AC&Al1FA`RR++9,;AFd}AF,,A"H+A&
0A
&A
C&hAB.GAX
	A0ACFdAF,A
CA5-,A6A7.A7r+AA"9r+<	9l,A:YA=1A=,A>.A?AACA B@+F,.AEqABf@+F,A&A"MC&,Afemulatesetoptextendedglobzmodloadzsh/datetimelocaloptmdatefmtintegeroptrreplysetzstyle:datetime:calendar_showdate:dateformatdatefmtdatefmt%a %b %d %H:%M:%S %Z %YshiftREPLYfdatefmt13,1print0: -f requires a date/time specificationreturndatefmtbreak optr  ! # Usage: 0 datespec [ ... ] # +12,1 ! replyset EPOCHSECONDSreplyset replyset calendar_scandateoptmREPLYreplysetstrftimedatefmtAfdCAF <ACfpҬA$ 8\p+rAg A(C <xAGJABCi
AP"HA8! AA"48d"fCf	A&ABCF0	CF|,A+rACF	AT		1^ARr
P2r
RaAFA\Ad	1A	faA	C<yA	aA8
A+AlA
iA0,\	)ACF	|	A"3	f	|d
-A
&A6r
A
F	|
AFQA9
AF	|IAFAX
	Afj	AF	|
!AFAX
	Afj
	ACF	|EAFAF	|iA"Lfk3=emulatesetoptextendedglobautoloadcalendar_readscandatelockfileslocalcalendarlineREPLYlockfilecalendar_entriestimeslines_sortedlines_unsortedlines_failedlockfilesintegerzstyle:datetime:calendar:calendarfilecalendarcalendar/calendarzmodloadzsh/systemb:zsystemzsystemsupportsflockzsystemcalendarcalendar_lockfilesexitcalendar.new.calendar_readcalendar_entriescalendar_entries1returncalendar_entriescalendar_scandateline(l.16..0.)REPLY:linelines_failed #lines_unsorted lines_sortedolines_unsorted09:lines_failed[@]printline # BAD DATE #lines_sorted lines_sorted[@]newWriting to new failed. #lines_failed Warning: lines with date that couldn't be parsed.
Output (with unparseable dates marked) left in newcalendar.oldCouldn't back-up calendar to calendar.old.
New calendar left in newFailed to rename new to calendar.
Old calendar left in calendar.oldOld calendar left in calendar.old #lockfiles lockfiles

Zerion Mini Shell 1.0