home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / remind / part12 < prev    next >
Encoding:
Text File  |  1992-11-10  |  37.0 KB  |  1,444 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject:  v33i069:  remind - A replacement for calendar, Part12/12
  4. Message-ID: <1992Nov10.042050.1507@sparky.imd.sterling.com>
  5. X-Md4-Signature: 02558b1ed9a51b888cef239a1d465844
  6. Date: Tue, 10 Nov 1992 04:20:50 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  10. Posting-number: Volume 33, Issue 69
  11. Archive-name: remind/part12
  12. Environment: UNIX, MS-DOS
  13. Supersedes: remind: Volume 17, Issue 3-6
  14.  
  15. #!/bin/sh
  16. # This is part 12 of Remind 03.00.00
  17. if touch 2>&1 | fgrep 'amc' > /dev/null
  18.  then TOUCH=touch
  19.  else TOUCH=true
  20. fi
  21. # ============= remind-all.csh ==============
  22. if test X"$1" != X"-c" -a -f 'remind-all.csh'; then
  23.     echo "File already exists: skipping 'remind-all.csh'"
  24. else
  25. echo "x - extracting remind-all.csh (Text)"
  26. sed 's/^X//' << 'SHAR_EOF' > remind-all.csh &&
  27. X#!/bin/csh -f
  28. X
  29. X# Shell script to mail all users reminders.
  30. X
  31. X# Run it AFTER MIDNIGHT so that date is correct!
  32. X# On our system, we have the following in our crontab:
  33. X# 05 5 * * * /usr/share/lib/remind/remind-all > /dev/null 2>&1
  34. X
  35. X# Also, you MUST use the -r and -q options on REMIND, otherwise SEVERE
  36. X# security hole could develop.  I recommend making this script
  37. X# readable and executable only by root to minimize security problems.
  38. X# DO NOT make the script setuid!
  39. X
  40. X# The following line gets a list of users for systems using SUN's
  41. X# NIS service:
  42. Xset USERS  = `ypcat passwd | awk -F: '{print $1}'`
  43. X
  44. X# The following line gets a list of users by examining /etc/passwd:
  45. X# set USERS = `awk -F: '{print $1}' /etc/passwd`
  46. X
  47. X# If neither of the above methods works, you must come up with some
  48. X# way of getting a list of users on the system
  49. X
  50. X# Set the following variables as appropriate for your system
  51. Xset REMIND = /usr/local/bin/remind
  52. Xset MAIL   = /usr/ucb/mail
  53. Xset RM     = "/usr/bin/rm -f"
  54. X
  55. Xset REMFILE   = /tmp/RemFile.$$
  56. X
  57. X# Scan each user's directory for a .reminders file
  58. Xforeach i ($USERS)
  59. X   if (-r ~$i/.reminders) then
  60. X
  61. X#     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  62. X
  63. X      su - $i -c "$REMIND -rqh ~$i/.reminders" < /dev/null > $REMFILE
  64. X      if (! -z $REMFILE) then
  65. X#        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  66. X
  67. X         $MAIL -s "Reminders" $i < $REMFILE
  68. X      endif
  69. X      $RM $REMFILE
  70. X   endif
  71. Xend
  72. SHAR_EOF
  73. $TOUCH -am 1109141292 remind-all.csh &&
  74. chmod 0600 remind-all.csh ||
  75. echo "restore of remind-all.csh failed"
  76. set `wc -c remind-all.csh`;Wc_c=$1
  77. if test "$Wc_c" != "1446"; then
  78.     echo original size 1446, current size $Wc_c
  79. fi
  80. fi
  81. # ============= remind-all.sh ==============
  82. if test X"$1" != X"-c" -a -f 'remind-all.sh'; then
  83.     echo "File already exists: skipping 'remind-all.sh'"
  84. else
  85. echo "x - extracting remind-all.sh (Text)"
  86. sed 's/^X//' << 'SHAR_EOF' > remind-all.sh &&
  87. X# Shell script to mail all users reminders.
  88. X
  89. X# Thanks to Bill Aten for this script.
  90. X
  91. X# Run it AFTER MIDNIGHT so that date is correct!
  92. X# On our system, we have the following in our crontab:
  93. X# 02 00 * * * /usr/local/adm/remind-all >/dev/null 2>&1
  94. X
  95. X# Also, you MUST use the -r and -q options on REMIND, otherwise a SEVERE
  96. X# security hole could develop.  I recommend making this script
  97. X# readable and executable only by root to minimize security problems.
  98. X# DO NOT make the script setuid!
  99. X
  100. X# The following line gets a list of users for systems using SUN's
  101. X# NIS service:
  102. X# USERS=`ypcat passwd | awk -F: '{print $1}'`
  103. X
  104. X# The following line gets a list of users by examining /etc/passwd:
  105. XUSERS=`awk -F: '{print $1}' /etc/passwd`
  106. X
  107. X# If neither of the above methods works, you must come up with some
  108. X# way of getting a list of users on the system
  109. X
  110. X# Set the following variables as appropriate for your system
  111. XREMIND=/usr/local/bin/remind
  112. XMAIL=/usr/bin/mail
  113. XRM="/bin/rm -f"
  114. X
  115. XREMFILE=/tmp/RemFile.$$
  116. X
  117. X# Scan each user's directory for a .reminders file
  118. Xfor i in $USERS
  119. Xdo
  120. XHOME=`grep \^$i: /etc/passwd | awk -F: '{print $6}'`
  121. X   if [ -r $HOME/.reminders ]; then
  122. X
  123. X#     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  124. X
  125. X      su - $i -c "$REMIND -rqh $HOME/.reminders" < /dev/null > $REMFILE
  126. X      if [ -s $REMFILE ]; then
  127. X#        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  128. X         $MAIL -s "Reminders" $i < $REMFILE
  129. X      fi
  130. X      $RM $REMFILE
  131. X   fi
  132. Xdone
  133. SHAR_EOF
  134. $TOUCH -am 1109141292 remind-all.sh &&
  135. chmod 0600 remind-all.sh ||
  136. echo "restore of remind-all.sh failed"
  137. set `wc -c remind-all.sh`;Wc_c=$1
  138. if test "$Wc_c" != "1472"; then
  139.     echo original size 1472, current size $Wc_c
  140. fi
  141. fi
  142. # ============= test.rem ==============
  143. if test X"$1" != X"-c" -a -f 'test.rem'; then
  144.     echo "File already exists: skipping 'test.rem'"
  145. else
  146. echo "x - extracting test.rem (Text)"
  147. sed 's/^X//' << 'SHAR_EOF' > test.rem &&
  148. X# Test file for REMIND
  149. X#
  150. X# Use this file to test the date calculation routines
  151. X# of the REMIND program by typing:
  152. X#
  153. X#     ./test-rem  # From WITHIN Remind source directory!
  154. X
  155. X# Test each possible case of the basic reminders.
  156. X
  157. XREM MSG Every Day
  158. X
  159. XREM 18 MSG Every 18th 
  160. XREM 15 MSG Every 15th
  161. X
  162. XREM Feb MSG February
  163. XREM Jan MSG January
  164. XREM March MSG March
  165. X
  166. XREM 13 Jan MSG 13 Jan
  167. XREM 15 Feb MSG 15 Feb
  168. XREM 28 Feb MSG 28 Feb
  169. XREM 29 Feb MSG 29 Feb
  170. XREM 5 Mar MSG 5 Mar
  171. X
  172. XREM 1990 MSG 1990
  173. XREM 1991 MSG 1991
  174. XREM 1992 MSG 1991
  175. X
  176. XREM 1 1990 MSG 1 1990
  177. XREM 29 1991 MSG 29 1991
  178. XREM 29 1992 MSG 29 1992
  179. XREM 16 1991 MSG 16 1991
  180. X
  181. XREM Jan 1990 MSG Jan 1990
  182. XREM Feb 1991 MSG Feb 1991
  183. XREM Dec 1991 MSG Dec 1991
  184. XREM May 1992 MSG May 1992
  185. X
  186. XREM 1 Jan 1991 MSG 1 Jan 1991
  187. XREM 16 Feb 1991 MSG 16 Feb 1991
  188. XREM 29 Dec 1992 MSG 29 Dec 1992
  189. X
  190. XREM Sun MSG Sun
  191. XREM Fri Sat Tue MSG Fri Sat Tue
  192. X
  193. XREM Sun 16 MSG Sun 16
  194. XREM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
  195. X
  196. XREM Sun Feb MSG Sun Feb
  197. XREM Mon Tue March MSG Mon Tue March
  198. X
  199. XREM Sun 16 Feb MSG Sun 16 Feb
  200. XREM Mon Tue 10 March MSG Mon Tue 10 March
  201. X
  202. XREM Sat Sun 1991 MSG Sat Sun 1991
  203. XREM Mon Tue 1992 MSG Mon Tue 1992
  204. X
  205. XREM Sun 16 1991 MSG Sun 16 1991
  206. XREM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
  207. X
  208. XREM Mon Feb 1991 MSG Mon Feb 1991
  209. XREM Tue Jan 1992 MSG Tue Jan 1992
  210. X
  211. XREM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
  212. XREM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
  213. X
  214. X# Try some Backs
  215. XCLEAR-OMIT-CONTEXT
  216. XREM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
  217. XREM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
  218. X
  219. XOMIT 28 Feb
  220. XREM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
  221. XREM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
  222. X
  223. XCLEAR-OMIT-CONTEXT
  224. X
  225. X# Try out UNTIL
  226. XREM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
  227. X
  228. X# Try playing with the OMIT context
  229. X
  230. XOMIT 28 Feb 1991
  231. XREM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  232. XREM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  233. XREM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  234. XREM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  235. XREM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  236. X
  237. XPUSH-OMIT-CONTEXT
  238. XCLEAR-OMIT-CONTEXT
  239. XREM 1 Mar -1 MSG 1 mar -1
  240. XREM 1 Mar --1 MSG 1 mar --1
  241. XREM 28 Feb BEFORE MSG 28 Feb BEFORE
  242. XREM 28 Feb SKIP MSG 28 Feb SKIP 
  243. XREM 28 Feb AFTER MSG 28 Feb AFTER
  244. X
  245. XPOP-OMIT-CONTEXT
  246. XREM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  247. XREM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  248. XREM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  249. XREM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  250. XREM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  251. X
  252. X
  253. XREM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
  254. X# Test BACK
  255. XCLEAR-OMIT-CONTEXT
  256. XREM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
  257. X
  258. XOMIT 17 Feb 1991
  259. XREM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
  260. XREM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
  261. X
  262. XCLEAR-OMIT-CONTEXT
  263. Xset a000 abs(1)
  264. Xset a001 abs(-1)
  265. Xset a002 asc("foo")
  266. Xset a003 baseyr()
  267. Xset a004 char(66,55,66,77,66)
  268. Xset a005 choose(3, "foo", "bar", "baz", "blech")
  269. Xset a006 coerce("string", 1)
  270. Xset a007 coerce("string", today())
  271. Xset a008 coerce("string", 11:44)
  272. Xset a009 coerce("int", "badnews")
  273. Xset a010 coerce("int", "12")
  274. Xset a011 coerce("int", 11:44)
  275. Xset a012 coerce("int", today())
  276. Xset a013 date(1992, 2, 2)
  277. Xset a014 date(1993, 2, 29)
  278. Xset a015 day(today())
  279. Xset a016 daysinmon(2, 1991)
  280. Xset a017 daysinmon(2, 1992)
  281. Xset a018 defined("a017")
  282. Xset a019 defined("a019")
  283. Xset a020 filename()
  284. Xset a021 getenv("TEST_GETENV")
  285. Xset a022 hour(11:22)
  286. Xset a023 iif(1, 1, 0)
  287. Xset a024 iif(0, 1, 0)
  288. Xset a025 index("barfoobar", "foo")
  289. Xset a026 index("barfoobar", "bar", 2)
  290. Xset a027 isleap(today())
  291. Xset a028 isleap(1992)
  292. Xomit [trigger(today())]
  293. Xset a030 isomitted(today())
  294. Xclear
  295. Xset a029 isomitted(today())
  296. Xset a031 lower("FOOBARBAZ")
  297. Xset a032 max(1, 2, 34, 1, 3)
  298. Xset a033 max("foo", "bar", "baz")
  299. Xset a034 max(today(), today()+1, today()-1)
  300. Xset a035 min(1, 2, 34, 1, 3)
  301. Xset a036 min("foo", "bar", "baz")
  302. Xset a037 min(today(), today()+1, today()-1)
  303. Xset a038 minute(11:33)
  304. Xset a039 mon(today())
  305. Xset a040 monnum(today())
  306. Xset a041 ord(3)
  307. Xset a042 ord(4)
  308. Xset a043 ostype()
  309. Xset a044 plural(2)
  310. Xset a045 plural(2, "ies")
  311. Xset a046 plural(2, "y", "ies")
  312. Xset a047 sgn(-2)
  313. Xset a048 shell("echo foo")
  314. Xset a049 strlen("sadjflkhsldkfhsdlfjhk")
  315. Xset a050 substr(a049, 2)
  316. Xset a051 substr(a050, 2, 6)
  317. Xset a052 time(1+2, 3+4)
  318. Xrem 10 jan 1992 AT 11:22 CAL
  319. Xset a053 trigdate()
  320. Xset a054 trigtime()
  321. Xset a055 trigvalid()
  322. Xset a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
  323. Xset a057 value("a05"+"6")
  324. Xset a058 version()
  325. Xset a059 wkday(today())
  326. Xset a060 wkdaynum(today())
  327. Xset a061 year(today())
  328. Xset a062 1+2*(3+4-(5*7/2))
  329. Xset a063 1>=2
  330. Xset a064 1<2 || 3 > 4
  331. Xset a065 1 && 1
  332. Xset a066 !a065
  333. Xset a067 typeof(2)
  334. Xset a068 typeof("foo")
  335. Xset a069 typeof(11:33)
  336. Xset a070 typeof(today())
  337. Xfset g(x,y) max(x,y)
  338. Xfset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
  339. Xset a071 g(1, 2)
  340. Xset a072 h(2, 3)
  341. Xset a073 h("foo", 11:33)
  342. SHAR_EOF
  343. $TOUCH -am 1109141292 test.rem &&
  344. chmod 0600 test.rem ||
  345. echo "restore of test.rem failed"
  346. set `wc -c test.rem`;Wc_c=$1
  347. if test "$Wc_c" != "4821"; then
  348.     echo original size 4821, current size $Wc_c
  349. fi
  350. fi
  351. # ============= test-rem ==============
  352. if test X"$1" != X"-c" -a -f 'test-rem'; then
  353.     echo "File already exists: skipping 'test-rem'"
  354. else
  355. echo "x - extracting test-rem (Text)"
  356. sed 's/^X//' << 'SHAR_EOF' > test-rem &&
  357. X#!/bin/csh -f
  358. Xsetenv TEST_GETENV "foo bar baz"
  359. X./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
  360. Xcmp -s ./test.out ./test.cmp
  361. Xif ($status == 0) then
  362. X   echo "Remind:  Acceptance test PASSED"
  363. X   exit 0
  364. Xelse
  365. X   echo "Remind:  Acceptance test FAILED"
  366. X   echo ""
  367. X   echo "Examine the file test.out to see where it differs from the"
  368. X   echo "reference file test.cmp."
  369. X   exit 1
  370. Xendif
  371. SHAR_EOF
  372. $TOUCH -am 1109141292 test-rem &&
  373. chmod 0700 test-rem ||
  374. echo "restore of test-rem failed"
  375. set `wc -c test-rem`;Wc_c=$1
  376. if test "$Wc_c" != "384"; then
  377.     echo original size 384, current size $Wc_c
  378. fi
  379. fi
  380. # ============= test.cmp ==============
  381. if test X"$1" != X"-c" -a -f 'test.cmp'; then
  382.     echo "File already exists: skipping 'test.cmp'"
  383. else
  384. echo "x - extracting test.cmp (Text)"
  385. sed 's/^X//' << 'SHAR_EOF' > test.cmp &&
  386. X# Test file for REMIND
  387. X#
  388. X# Use this file to test the date calculation routines
  389. X# of the REMIND program by typing:
  390. X#
  391. X#     ./test-rem  # From WITHIN Remind source directory!
  392. X
  393. X# Test each possible case of the basic reminders.
  394. X
  395. XREM MSG Every Day
  396. X./test.rem(10): Trig = Saturday, 16 February, 1991
  397. XReminders for Saturday, 16th February, 1991:
  398. X
  399. XEvery Day
  400. X
  401. X
  402. XREM 18 MSG Every 18th 
  403. X./test.rem(12): Trig = Monday, 18 February, 1991
  404. XREM 15 MSG Every 15th
  405. X./test.rem(13): Trig = Friday, 15 March, 1991
  406. X
  407. XREM Feb MSG February
  408. X./test.rem(15): Trig = Saturday, 16 February, 1991
  409. XFebruary
  410. X
  411. XREM Jan MSG January
  412. X./test.rem(16): Trig = Wednesday, 1 January, 1992
  413. XREM March MSG March
  414. X./test.rem(17): Trig = Friday, 1 March, 1991
  415. X
  416. XREM 13 Jan MSG 13 Jan
  417. X./test.rem(19): Trig = Monday, 13 January, 1992
  418. XREM 15 Feb MSG 15 Feb
  419. X./test.rem(20): Trig = Saturday, 15 February, 1992
  420. XREM 28 Feb MSG 28 Feb
  421. X./test.rem(21): Trig = Thursday, 28 February, 1991
  422. XREM 29 Feb MSG 29 Feb
  423. X./test.rem(22): Trig = Saturday, 29 February, 1992
  424. XREM 5 Mar MSG 5 Mar
  425. X./test.rem(23): Trig = Tuesday, 5 March, 1991
  426. X
  427. XREM 1990 MSG 1990
  428. X./test.rem(25): Expired
  429. XREM 1991 MSG 1991
  430. X./test.rem(26): Trig = Saturday, 16 February, 1991
  431. X1991
  432. X
  433. XREM 1992 MSG 1991
  434. X./test.rem(27): Trig = Wednesday, 1 January, 1992
  435. X
  436. XREM 1 1990 MSG 1 1990
  437. X./test.rem(29): Expired
  438. XREM 29 1991 MSG 29 1991
  439. X./test.rem(30): Trig = Friday, 29 March, 1991
  440. XREM 29 1992 MSG 29 1992
  441. X./test.rem(31): Trig = Wednesday, 29 January, 1992
  442. XREM 16 1991 MSG 16 1991
  443. X./test.rem(32): Trig = Saturday, 16 February, 1991
  444. X16 1991
  445. X
  446. X
  447. XREM Jan 1990 MSG Jan 1990
  448. X./test.rem(34): Expired
  449. XREM Feb 1991 MSG Feb 1991
  450. X./test.rem(35): Trig = Saturday, 16 February, 1991
  451. XFeb 1991
  452. X
  453. XREM Dec 1991 MSG Dec 1991
  454. X./test.rem(36): Trig = Sunday, 1 December, 1991
  455. XREM May 1992 MSG May 1992
  456. X./test.rem(37): Trig = Friday, 1 May, 1992
  457. X
  458. XREM 1 Jan 1991 MSG 1 Jan 1991
  459. X./test.rem(39): Expired
  460. XREM 16 Feb 1991 MSG 16 Feb 1991
  461. X./test.rem(40): Trig = Saturday, 16 February, 1991
  462. X16 Feb 1991
  463. X
  464. XREM 29 Dec 1992 MSG 29 Dec 1992
  465. X./test.rem(41): Trig = Tuesday, 29 December, 1992
  466. X
  467. XREM Sun MSG Sun
  468. X./test.rem(43): Trig = Sunday, 17 February, 1991
  469. XREM Fri Sat Tue MSG Fri Sat Tue
  470. X./test.rem(44): Trig = Saturday, 16 February, 1991
  471. XFri Sat Tue
  472. X
  473. X
  474. XREM Sun 16 MSG Sun 16
  475. X./test.rem(46): Trig = Sunday, 17 February, 1991
  476. XREM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
  477. X./test.rem(47): Trig = Friday, 1 March, 1991
  478. X
  479. XREM Sun Feb MSG Sun Feb
  480. X./test.rem(49): Trig = Sunday, 17 February, 1991
  481. XREM Mon Tue March MSG Mon Tue March
  482. X./test.rem(50): Trig = Monday, 4 March, 1991
  483. X
  484. XREM Sun 16 Feb MSG Sun 16 Feb
  485. X./test.rem(52): Trig = Sunday, 17 February, 1991
  486. XREM Mon Tue 10 March MSG Mon Tue 10 March
  487. X./test.rem(53): Trig = Monday, 11 March, 1991
  488. X
  489. XREM Sat Sun 1991 MSG Sat Sun 1991
  490. X./test.rem(55): Trig = Saturday, 16 February, 1991
  491. XSat Sun 1991
  492. X
  493. XREM Mon Tue 1992 MSG Mon Tue 1992
  494. X./test.rem(56): Trig = Monday, 6 January, 1992
  495. X
  496. XREM Sun 16 1991 MSG Sun 16 1991
  497. X./test.rem(58): Trig = Sunday, 17 February, 1991
  498. XREM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
  499. X./test.rem(59): Trig = Wednesday, 1 January, 1992
  500. X
  501. XREM Mon Feb 1991 MSG Mon Feb 1991
  502. X./test.rem(61): Trig = Monday, 18 February, 1991
  503. XREM Tue Jan 1992 MSG Tue Jan 1992
  504. X./test.rem(62): Trig = Tuesday, 7 January, 1992
  505. X
  506. XREM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
  507. X./test.rem(64): Trig = Sunday, 17 February, 1991
  508. XREM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
  509. X./test.rem(65): Trig = Tuesday, 28 January, 1992
  510. X
  511. X# Try some Backs
  512. XCLEAR-OMIT-CONTEXT
  513. XREM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
  514. X./test.rem(69): Trig = Thursday, 28 February, 1991
  515. XREM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
  516. X./test.rem(70): Trig = Thursday, 28 February, 1991
  517. X
  518. XOMIT 28 Feb
  519. XREM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
  520. X./test.rem(73): Trig = Wednesday, 27 February, 1991
  521. XREM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
  522. X./test.rem(74): Trig = Thursday, 28 February, 1991
  523. X
  524. XCLEAR-OMIT-CONTEXT
  525. X
  526. X# Try out UNTIL
  527. XREM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
  528. X./test.rem(79): Trig = Wednesday, 20 February, 1991
  529. X
  530. X# Try playing with the OMIT context
  531. X
  532. XOMIT 28 Feb 1991
  533. XREM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  534. X./test.rem(84): Trig = Wednesday, 27 February, 1991
  535. XREM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  536. X./test.rem(85): Trig = Thursday, 28 February, 1991
  537. XREM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  538. X./test.rem(86): Trig = Wednesday, 27 February, 1991
  539. XREM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  540. X./test.rem(87): Trig = Friday, 28 February, 1992
  541. XREM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  542. X./test.rem(88): Trig = Friday, 1 March, 1991
  543. X
  544. XPUSH-OMIT-CONTEXT
  545. XCLEAR-OMIT-CONTEXT
  546. XREM 1 Mar -1 MSG 1 mar -1
  547. X./test.rem(92): Trig = Thursday, 28 February, 1991
  548. XREM 1 Mar --1 MSG 1 mar --1
  549. X./test.rem(93): Trig = Thursday, 28 February, 1991
  550. XREM 28 Feb BEFORE MSG 28 Feb BEFORE
  551. X./test.rem(94): Trig = Thursday, 28 February, 1991
  552. XREM 28 Feb SKIP MSG 28 Feb SKIP 
  553. X./test.rem(95): Trig = Thursday, 28 February, 1991
  554. XREM 28 Feb AFTER MSG 28 Feb AFTER
  555. X./test.rem(96): Trig = Thursday, 28 February, 1991
  556. X
  557. XPOP-OMIT-CONTEXT
  558. XREM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  559. X./test.rem(99): Trig = Wednesday, 27 February, 1991
  560. XREM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  561. X./test.rem(100): Trig = Thursday, 28 February, 1991
  562. XREM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  563. X./test.rem(101): Trig = Wednesday, 27 February, 1991
  564. XREM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  565. X./test.rem(102): Trig = Friday, 28 February, 1992
  566. XREM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  567. X./test.rem(103): Trig = Friday, 1 March, 1991
  568. X
  569. X
  570. XREM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
  571. X./test.rem(106): Trig = Wednesday, 13 March, 1991
  572. X# Test BACK
  573. XCLEAR-OMIT-CONTEXT
  574. XREM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
  575. X./test.rem(110): Trig = Monday, 18 February, 1991
  576. X
  577. XOMIT 17 Feb 1991
  578. XREM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
  579. X./test.rem(113): Trig = Monday, 18 February, 1991
  580. X18 Feb 1991 +1 (17Feb91 omitted)
  581. X
  582. XREM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
  583. X./test.rem(114): Trig = Monday, 18 February, 1991
  584. X
  585. XCLEAR-OMIT-CONTEXT
  586. Xset a000 abs(1)
  587. Xabs(1) => 1
  588. Xset a001 abs(-1)
  589. X- 1 => -1
  590. Xabs(-1) => 1
  591. Xset a002 asc("foo")
  592. Xasc("foo") => 102
  593. Xset a003 baseyr()
  594. Xbaseyr() => 1990
  595. Xset a004 char(66,55,66,77,66)
  596. Xchar(66, 55, 66, 77, 66) => "B7BMB"
  597. Xset a005 choose(3, "foo", "bar", "baz", "blech")
  598. Xchoose(3, "foo", "bar", "baz", "blech") => "baz"
  599. Xset a006 coerce("string", 1)
  600. Xcoerce("string", 1) => "1"
  601. Xset a007 coerce("string", today())
  602. Xtoday() => 1991/02/16
  603. Xcoerce("string", 1991/02/16) => "1991/02/16"
  604. Xset a008 coerce("string", 11:44)
  605. Xcoerce("string", 11:44) => "11:44"
  606. Xset a009 coerce("int", "badnews")
  607. Xcoerce("int", "badnews") => Can't coerce
  608. X./test.rem(126): Can't coerce
  609. Xset a010 coerce("int", "12")
  610. Xcoerce("int", "12") => 12
  611. Xset a011 coerce("int", 11:44)
  612. Xcoerce("int", 11:44) => 704
  613. Xset a012 coerce("int", today())
  614. Xtoday() => 1991/02/16
  615. Xcoerce("int", 1991/02/16) => 411
  616. Xset a013 date(1992, 2, 2)
  617. Xdate(1992, 2, 2) => 1992/02/02
  618. Xset a014 date(1993, 2, 29)
  619. Xdate(1993, 2, 29) => Bad date specification
  620. X./test.rem(131): Bad date specification
  621. Xset a015 day(today())
  622. Xtoday() => 1991/02/16
  623. Xday(1991/02/16) => 16
  624. Xset a016 daysinmon(2, 1991)
  625. Xdaysinmon(2, 1991) => 28
  626. Xset a017 daysinmon(2, 1992)
  627. Xdaysinmon(2, 1992) => 29
  628. Xset a018 defined("a017")
  629. Xdefined("a017") => 1
  630. Xset a019 defined("a019")
  631. Xdefined("a019") => 0
  632. Xset a020 filename()
  633. Xfilename() => "./test.rem"
  634. Xset a021 getenv("TEST_GETENV")
  635. Xgetenv("TEST_GETENV") => "foo bar baz"
  636. Xset a022 hour(11:22)
  637. Xhour(11:22) => 11
  638. Xset a023 iif(1, 1, 0)
  639. Xiif(1, 1, 0) => 1
  640. Xset a024 iif(0, 1, 0)
  641. Xiif(0, 1, 0) => 0
  642. Xset a025 index("barfoobar", "foo")
  643. Xindex("barfoobar", "foo") => 4
  644. Xset a026 index("barfoobar", "bar", 2)
  645. Xindex("barfoobar", "bar", 2) => 7
  646. Xset a027 isleap(today())
  647. Xtoday() => 1991/02/16
  648. Xisleap(1991/02/16) => 0
  649. Xset a028 isleap(1992)
  650. Xisleap(1992) => 1
  651. Xomit [trigger(today())]
  652. Xtoday() => 1991/02/16
  653. Xtrigger(1991/02/16) => "16 February 1991"
  654. Xset a030 isomitted(today())
  655. Xtoday() => 1991/02/16
  656. Xisomitted(1991/02/16) => 1
  657. Xclear
  658. Xset a029 isomitted(today())
  659. Xtoday() => 1991/02/16
  660. Xisomitted(1991/02/16) => 0
  661. Xset a031 lower("FOOBARBAZ")
  662. Xlower("FOOBARBAZ") => "foobarbaz"
  663. Xset a032 max(1, 2, 34, 1, 3)
  664. Xmax(1, 2, 34, 1, 3) => 34
  665. Xset a033 max("foo", "bar", "baz")
  666. Xmax("foo", "bar", "baz") => "foo"
  667. Xset a034 max(today(), today()+1, today()-1)
  668. Xtoday() => 1991/02/16
  669. Xtoday() => 1991/02/16
  670. X1991/02/16 + 1 => 1991/02/17
  671. Xtoday() => 1991/02/16
  672. X1991/02/16 - 1 => 1991/02/15
  673. Xmax(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/17
  674. Xset a035 min(1, 2, 34, 1, 3)
  675. Xmin(1, 2, 34, 1, 3) => 1
  676. Xset a036 min("foo", "bar", "baz")
  677. Xmin("foo", "bar", "baz") => "bar"
  678. Xset a037 min(today(), today()+1, today()-1)
  679. Xtoday() => 1991/02/16
  680. Xtoday() => 1991/02/16
  681. X1991/02/16 + 1 => 1991/02/17
  682. Xtoday() => 1991/02/16
  683. X1991/02/16 - 1 => 1991/02/15
  684. Xmin(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/15
  685. Xset a038 minute(11:33)
  686. Xminute(11:33) => 33
  687. Xset a039 mon(today())
  688. Xtoday() => 1991/02/16
  689. Xmon(1991/02/16) => "February"
  690. Xset a040 monnum(today())
  691. Xtoday() => 1991/02/16
  692. Xmonnum(1991/02/16) => 2
  693. Xset a041 ord(3)
  694. Xord(3) => "3rd"
  695. Xset a042 ord(4)
  696. Xord(4) => "4th"
  697. Xset a043 ostype()
  698. Xostype() => "UNIX"
  699. Xset a044 plural(2)
  700. Xplural(2) => "s"
  701. Xset a045 plural(2, "ies")
  702. Xplural(2, "ies") => "iess"
  703. Xset a046 plural(2, "y", "ies")
  704. Xplural(2, "y", "ies") => "ies"
  705. Xset a047 sgn(-2)
  706. X- 2 => -2
  707. Xsgn(-2) => -1
  708. Xset a048 shell("echo foo")
  709. Xshell("echo foo") => "foo"
  710. Xset a049 strlen("sadjflkhsldkfhsdlfjhk")
  711. Xstrlen("sadjflkhsldkfhsdlfjhk") => 21
  712. Xset a050 substr(a049, 2)
  713. Xa049 => 21
  714. Xsubstr(21, 2) => Type mismatch
  715. X./test.rem(169): Type mismatch
  716. Xset a051 substr(a050, 2, 6)
  717. Xa050 => ./test.rem(170): Undefined variable: a050
  718. Xset a052 time(1+2, 3+4)
  719. X1 + 2 => 3
  720. X3 + 4 => 7
  721. Xtime(3, 7) => 03:07
  722. Xrem 10 jan 1992 AT 11:22 CAL
  723. X./test.rem(172): Trig = Friday, 10 January, 1992
  724. Xset a053 trigdate()
  725. Xtrigdate() => 1992/01/10
  726. Xset a054 trigtime()
  727. Xtrigtime() => 11:22
  728. Xset a055 trigvalid()
  729. Xtrigvalid() => 1
  730. Xset a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
  731. Xupper("sdfjhsdf ksjdfh kjsdfh ksjdfh") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  732. Xset a057 value("a05"+"6")
  733. X"a05" + "6" => "a056"
  734. Xvalue("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  735. Xset a058 version()
  736. Xversion() => "03.00.00"
  737. Xset a059 wkday(today())
  738. Xtoday() => 1991/02/16
  739. Xwkday(1991/02/16) => "Saturday"
  740. Xset a060 wkdaynum(today())
  741. Xtoday() => 1991/02/16
  742. Xwkdaynum(1991/02/16) => 6
  743. Xset a061 year(today())
  744. Xtoday() => 1991/02/16
  745. Xyear(1991/02/16) => 1991
  746. Xset a062 1+2*(3+4-(5*7/2))
  747. X3 + 4 => 7
  748. X5 * 7 => 35
  749. X35 / 2 => 17
  750. X7 - 17 => -10
  751. X2 * -10 => -20
  752. X1 + -20 => -19
  753. Xset a063 1>=2
  754. X1 >= 2 => 0
  755. Xset a064 1<2 || 3 > 4
  756. X1 < 2 => 1
  757. X3 > 4 => 0
  758. X1 || 0 => 1
  759. Xset a065 1 && 1
  760. X1 && 1 => 1
  761. Xset a066 !a065
  762. Xa065 => 1
  763. X! 1 => 0
  764. Xset a067 typeof(2)
  765. Xtypeof(2) => "INT"
  766. Xset a068 typeof("foo")
  767. Xtypeof("foo") => "STRING"
  768. Xset a069 typeof(11:33)
  769. Xtypeof(11:33) => "TIME"
  770. Xset a070 typeof(today())
  771. Xtoday() => 1991/02/16
  772. Xtypeof(1991/02/16) => "DATE"
  773. Xfset g(x,y) max(x,y)
  774. Xfset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
  775. Xset a071 g(1, 2)
  776. XUserFN g(1, 2)
  777. Xx => 1
  778. Xy => 2
  779. Xmax(1, 2) => 2
  780. XLeaving UserFN g() => 2
  781. Xset a072 h(2, 3)
  782. XUserFN h(2, 3)
  783. Xx => 2
  784. Xy => 3
  785. X2 + 3 => 5
  786. Xx => 2
  787. Xy => 3
  788. X2 * 3 => 6
  789. XUserFN g(5, 6)
  790. Xx => 5
  791. Xy => 6
  792. Xmax(5, 6) => 6
  793. XLeaving UserFN g() => 6
  794. Xx => 2
  795. Xy => 3
  796. X2 - 3 => -1
  797. Xx => 2
  798. Xy => 3
  799. X2 / 3 => 0
  800. XUserFN g(-1, 0)
  801. Xx => -1
  802. Xy => 0
  803. Xmax(-1, 0) => 0
  804. XLeaving UserFN g() => 0
  805. Xmin(6, 0) => 0
  806. XLeaving UserFN h() => 0
  807. Xset a073 h("foo", 11:33)
  808. XUserFN h("foo", 11:33)
  809. Xx => "foo"
  810. Xy => 11:33
  811. X"foo" + 11:33 => "foo11:33"
  812. Xx => "foo"
  813. Xy => 11:33
  814. X"foo" * 11:33 => Type mismatch
  815. X./test.rem(195): Operator '*' Type mismatch
  816. XLeaving UserFN h() => Type mismatch
  817. X
  818. X    Variable  Value
  819. X
  820. X        a017  29
  821. X        a036  "bar"
  822. X        a055  1
  823. X        a008  "11:44"
  824. X        a027  0
  825. X        a046  "ies"
  826. X        a065  1
  827. X        a018  1
  828. X        a037  1991/02/15
  829. X        a056  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  830. X        a028  1
  831. X        a047  -1
  832. X        a066  0
  833. X        a019  0
  834. X        a038  33
  835. X        a057  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  836. X        a029  0
  837. X        a048  "foo"
  838. X        a067  "INT"
  839. X        a039  "February"
  840. X        a058  "03.00.00"
  841. X        a049  21
  842. X        a068  "STRING"
  843. X        a059  "Saturday"
  844. X        a069  "TIME"
  845. X        a000  1
  846. X        a010  12
  847. X        a001  1
  848. X        a020  "./test.rem"
  849. X        a011  704
  850. X        a030  1
  851. X        a002  102
  852. X        a021  "foo bar baz"
  853. X        a040  2
  854. X        a012  411
  855. X        a031  "foobarbaz"
  856. X        a003  1990
  857. X        a022  11
  858. X        a041  "3rd"
  859. X        a060  6
  860. X        a013  1992/02/02
  861. X        a032  34
  862. X        a070  "DATE"
  863. X        a004  "B7BMB"
  864. X        a023  1
  865. X        a042  "4th"
  866. X        a061  1991
  867. X        a033  "foo"
  868. X        a052  03:07
  869. X        a071  2
  870. X        a005  "baz"
  871. X        a024  0
  872. X        a043  "UNIX"
  873. X        a062  -19
  874. X        a015  16
  875. X        a034  1991/02/17
  876. X        a053  1992/01/10
  877. X        a072  0
  878. X        a006  "1"
  879. X        a025  4
  880. X        a044  "s"
  881. X        a063  0
  882. X        a016  28
  883. X        a035  1
  884. X        a054  11:22
  885. X        a007  "1991/02/16"
  886. X        a026  7
  887. X        a045  "iess"
  888. X        a064  1
  889. SHAR_EOF
  890. $TOUCH -am 1109141292 test.cmp &&
  891. chmod 0600 test.cmp ||
  892. echo "restore of test.cmp failed"
  893. set `wc -c test.cmp`;Wc_c=$1
  894. if test "$Wc_c" != "12909"; then
  895.     echo original size 12909, current size $Wc_c
  896. fi
  897. fi
  898. # ============= makefile.tc ==============
  899. if test X"$1" != X"-c" -a -f 'makefile.tc'; then
  900.     echo "File already exists: skipping 'makefile.tc'"
  901. else
  902. echo "x - extracting makefile.tc (Text)"
  903. sed 's/^X//' << 'SHAR_EOF' > makefile.tc &&
  904. X# Makefile for REMIND for Turbo C for MSDOS
  905. X
  906. XVERSION= 03.00.00
  907. X
  908. XHDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  909. X
  910. XSTDHDRS= config.h types.h protos.h globals.h err.h
  911. X
  912. XSRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  913. Xmain.c omit.c token.c trigger.c userfns.c utils.c var.c
  914. X
  915. XOBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  916. Xglobals.obj init.obj main.obj omit.obj token.obj trigger.obj \
  917. Xutils.obj userfns.obj var.obj
  918. X
  919. XMANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
  920. Xremind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
  921. Xmakefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1
  922. X
  923. Xremind.exe: $(OBJS)
  924. X    tcc @lnk.tc
  925. X
  926. X.c.obj:
  927. X    tcc -A -w-pia -c -O -ms {$< }
  928. X
  929. Xcalendar.obj: calendar.c $(STDHDRS) expr.h
  930. X
  931. Xdorem.obj: dorem.c $(STDHDRS) expr.h
  932. X
  933. Xdosubst.obj: dosubst.c $(STDHDRS)
  934. X
  935. Xexpr.obj: expr.c $(STDHDRS) expr.h
  936. X
  937. Xfiles.obj: files.c $(STDHDRS)
  938. X
  939. Xfuncs.obj: funcs.c $(STDHDRS) expr.h version.h
  940. X
  941. Xglobals.obj: globals.c config.h types.h globals.h err.h
  942. X
  943. Xinit.obj: init.c $(STDHDRS) expr.h version.h
  944. X
  945. Xmain.obj: main.c $(STDHDRS) expr.h
  946. X
  947. Xomit.obj: omit.c $(STDHDRS)
  948. X
  949. Xtoken.obj: token.c $(STDHDRS)
  950. X
  951. Xtrigger.obj: trigger.c $(STDHDRS) expr.h
  952. X
  953. Xuserfns.obj: userfns.c $(STDHDRS) expr.h
  954. X
  955. Xutils.obj: utils.c $(STDHDRS)
  956. X
  957. Xvar.obj: var.c $(STDHDRS) expr.h
  958. X
  959. Xremind.zoo: $(MANIFEST)
  960. X    zoo aI remind.zoo < manifest.dos
  961. X
  962. SHAR_EOF
  963. $TOUCH -am 1109141292 makefile.tc &&
  964. chmod 0600 makefile.tc ||
  965. echo "restore of makefile.tc failed"
  966. set `wc -c makefile.tc`;Wc_c=$1
  967. if test "$Wc_c" != "1426"; then
  968.     echo original size 1426, current size $Wc_c
  969. fi
  970. fi
  971. # ============= makefile.msc ==============
  972. if test X"$1" != X"-c" -a -f 'makefile.msc'; then
  973.     echo "File already exists: skipping 'makefile.msc'"
  974. else
  975. echo "x - extracting makefile.msc (Text)"
  976. sed 's/^X//' << 'SHAR_EOF' > makefile.msc &&
  977. X# Makefile for REMIND for Microsoft C for MSDOS
  978. X
  979. XOBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  980. Xglobals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
  981. Xutils.obj var.obj
  982. X
  983. XDEFINES= /D__MSDOS__ /D__MSC__
  984. X
  985. XMODEL= /AS
  986. X
  987. Xcalendar.obj: calendar.c
  988. X    cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
  989. X
  990. Xdorem.obj: dorem.c
  991. X    cl /c $(DEFINES) $(MODEL) /Fodorem.obj dorem.c
  992. X
  993. Xdosubst.obj: dosubst.c
  994. X    cl /c $(DEFINES) $(MODEL) /Fodosubst.obj dosubst.c
  995. X
  996. Xexpr.obj: expr.c
  997. X    cl /c $(DEFINES) $(MODEL) /Foexpr.obj expr.c
  998. X
  999. Xfiles.obj: files.c
  1000. X    cl /c $(DEFINES) $(MODEL) /Fofiles.obj files.c
  1001. X
  1002. Xfuncs.obj: funcs.c
  1003. X    cl /c $(DEFINES) $(MODEL) /Fofuncs.obj funcs.c
  1004. X
  1005. Xglobals.obj: globals.c
  1006. X    cl /c $(DEFINES) $(MODEL) /Foglobals.obj globals.c
  1007. X
  1008. Xinit.obj: init.c
  1009. X    cl /c $(DEFINES) $(MODEL) /Foinit.obj init.c
  1010. X
  1011. Xmain.obj: main.c
  1012. X    cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
  1013. X
  1014. Xomit.obj: omit.c
  1015. X    cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
  1016. X
  1017. Xtoken.obj: token.c
  1018. X    cl /c $(DEFINES) $(MODEL) /Fotoken.obj token.c
  1019. X
  1020. Xtrigger.obj: trigger.c
  1021. X    cl /c $(DEFINES) $(MODEL) /Fotrigger.obj trigger.c
  1022. X
  1023. Xuserfns.obj: userfns.c
  1024. X    cl /c $(DEFINES) $(MODEL) /Fouserfns.obj userfns.c
  1025. X
  1026. Xutils.obj: utils.c
  1027. X    cl /c $(DEFINES) $(MODEL) /Foutils.obj utils.c
  1028. X
  1029. Xvar.obj: var.c
  1030. X    cl /c $(DEFINES) $(MODEL) /Fovar.obj var.c
  1031. X
  1032. Xremind.exe: $(OBJS)
  1033. X    link /NOI @lnk.msc
  1034. SHAR_EOF
  1035. $TOUCH -am 1109141292 makefile.msc &&
  1036. chmod 0600 makefile.msc ||
  1037. echo "restore of makefile.msc failed"
  1038. set `wc -c makefile.msc`;Wc_c=$1
  1039. if test "$Wc_c" != "1339"; then
  1040.     echo original size 1339, current size $Wc_c
  1041. fi
  1042. fi
  1043. # ============= lnk.msc ==============
  1044. if test X"$1" != X"-c" -a -f 'lnk.msc'; then
  1045.     echo "File already exists: skipping 'lnk.msc'"
  1046. else
  1047. echo "x - extracting lnk.msc (Text)"
  1048. sed 's/^X//' << 'SHAR_EOF' > lnk.msc &&
  1049. Xcalendar.obj +
  1050. Xdorem.obj +
  1051. Xdosubst.obj +
  1052. Xexpr.obj +
  1053. Xfiles.obj +
  1054. Xfuncs.obj +
  1055. Xglobals.obj +
  1056. Xinit.obj +
  1057. Xmain.obj +
  1058. Xomit.obj +
  1059. Xtoken.obj +
  1060. Xtrigger.obj +
  1061. Xuserfns.obj +
  1062. Xutils.obj +
  1063. Xvar.obj
  1064. Xremind.exe
  1065. Xnul
  1066. X
  1067. X
  1068. X
  1069. SHAR_EOF
  1070. $TOUCH -am 1109141292 lnk.msc &&
  1071. chmod 0600 lnk.msc ||
  1072. echo "restore of lnk.msc failed"
  1073. set `wc -c lnk.msc`;Wc_c=$1
  1074. if test "$Wc_c" != "201"; then
  1075.     echo original size 201, current size $Wc_c
  1076. fi
  1077. fi
  1078. # ============= lnk.tc ==============
  1079. if test X"$1" != X"-c" -a -f 'lnk.tc'; then
  1080.     echo "File already exists: skipping 'lnk.tc'"
  1081. else
  1082. echo "x - extracting lnk.tc (Text)"
  1083. sed 's/^X//' << 'SHAR_EOF' > lnk.tc &&
  1084. X-eremind.exe
  1085. Xcalendar.obj
  1086. Xdorem.obj
  1087. Xdosubst.obj
  1088. Xexpr.obj
  1089. Xfiles.obj
  1090. Xfuncs.obj
  1091. Xglobals.obj
  1092. Xinit.obj
  1093. Xmain.obj
  1094. Xomit.obj
  1095. Xtoken.obj
  1096. Xtrigger.obj
  1097. Xuserfns.obj
  1098. Xutils.obj
  1099. Xvar.obj
  1100. SHAR_EOF
  1101. $TOUCH -am 1109141292 lnk.tc &&
  1102. chmod 0600 lnk.tc ||
  1103. echo "restore of lnk.tc failed"
  1104. set `wc -c lnk.tc`;Wc_c=$1
  1105. if test "$Wc_c" != "168"; then
  1106.     echo original size 168, current size $Wc_c
  1107. fi
  1108. fi
  1109. # ============= MANIFEST.UNX ==============
  1110. if test X"$1" != X"-c" -a -f 'MANIFEST.UNX'; then
  1111.     echo "File already exists: skipping 'MANIFEST.UNX'"
  1112. else
  1113. echo "x - extracting MANIFEST.UNX (Text)"
  1114. sed 's/^X//' << 'SHAR_EOF' > MANIFEST.UNX &&
  1115. Xcalendar.c
  1116. Xconfig.h
  1117. XCOPYRIGHT
  1118. Xdorem.c
  1119. Xdosubst.c
  1120. Xerr.h
  1121. Xexpr.c
  1122. Xexpr.h
  1123. Xfiles.c
  1124. Xfuncs.c
  1125. Xglobals.c
  1126. Xglobals.h
  1127. Xinit.c
  1128. Xkall
  1129. Xkall.1
  1130. Xlnk.msc
  1131. Xlnk.tc
  1132. Xmain.c
  1133. XMakefile
  1134. Xmakefile.msc
  1135. Xmakefile.tc
  1136. XMANIFEST.DOS
  1137. XMANIFEST.UNX
  1138. Xomit.c
  1139. Xprotos.h
  1140. Xqueue.c
  1141. XREADME.DOS
  1142. XREADME.UNIX
  1143. Xrem
  1144. Xrem.1
  1145. Xremind-all.csh
  1146. Xremind-all.sh
  1147. Xremind.1
  1148. Xtest-rem
  1149. Xtest.cmp
  1150. Xtest.rem
  1151. Xtoken.c
  1152. Xtrigger.c
  1153. Xtypes.h
  1154. Xuserfns.c
  1155. Xutils.c
  1156. Xvar.c
  1157. Xversion.h
  1158. XWHATSNEW.30
  1159. SHAR_EOF
  1160. $TOUCH -am 1109141292 MANIFEST.UNX &&
  1161. chmod 0600 MANIFEST.UNX ||
  1162. echo "restore of MANIFEST.UNX failed"
  1163. set `wc -c MANIFEST.UNX`;Wc_c=$1
  1164. if test "$Wc_c" != "399"; then
  1165.     echo original size 399, current size $Wc_c
  1166. fi
  1167. fi
  1168. # ============= MANIFEST.DOS ==============
  1169. if test X"$1" != X"-c" -a -f 'MANIFEST.DOS'; then
  1170.     echo "File already exists: skipping 'MANIFEST.DOS'"
  1171. else
  1172. echo "x - extracting MANIFEST.DOS (Text)"
  1173. sed 's/^X//' << 'SHAR_EOF' > MANIFEST.DOS &&
  1174. Xcalendar.c
  1175. Xconfig.h
  1176. Xcopyrigh
  1177. Xdorem.c
  1178. Xdosubst.c
  1179. Xerr.h
  1180. Xexpr.c
  1181. Xexpr.h
  1182. Xfiles.c
  1183. Xfuncs.c
  1184. Xglobals.c
  1185. Xglobals.h
  1186. Xinit.c
  1187. Xkall
  1188. Xkall.1
  1189. Xlnk.msc
  1190. Xlnk.tc
  1191. Xmain.c
  1192. Xmakefile
  1193. Xmakefile.msc
  1194. Xmakefile.tc
  1195. Xmanifest.dos
  1196. Xmanifest.unx
  1197. Xomit.c
  1198. Xprotos.h
  1199. Xqueue.c
  1200. Xreadme.dos
  1201. Xreadme.uni
  1202. Xrem
  1203. Xrem.1
  1204. Xremind-a.csh
  1205. Xremind-a.sh
  1206. Xremind.1
  1207. Xtest-rem
  1208. Xtest.cmp
  1209. Xtest.rem
  1210. Xtoken.c
  1211. Xtrigger.c
  1212. Xtypes.h
  1213. Xuserfns.c
  1214. Xutils.c
  1215. Xvar.c
  1216. Xversion.h
  1217. Xwhatsnew.30
  1218. SHAR_EOF
  1219. $TOUCH -am 1109141292 MANIFEST.DOS &&
  1220. chmod 0600 MANIFEST.DOS ||
  1221. echo "restore of MANIFEST.DOS failed"
  1222. set `wc -c MANIFEST.DOS`;Wc_c=$1
  1223. if test "$Wc_c" != "393"; then
  1224.     echo original size 393, current size $Wc_c
  1225. fi
  1226. fi
  1227. # ============= WHATSNEW.30 ==============
  1228. if test X"$1" != X"-c" -a -f 'WHATSNEW.30'; then
  1229.     echo "File already exists: skipping 'WHATSNEW.30'"
  1230. else
  1231. echo "x - extracting WHATSNEW.30 (Text)"
  1232. sed 's/^X//' << 'SHAR_EOF' > WHATSNEW.30 &&
  1233. XCHANGES TO REMIND
  1234. X
  1235. X* Version 3.0
  1236. X
  1237. X- Total rewrite from previous versions
  1238. X
  1239. X- Added variables, expressions, flow-control statements, daemon mode
  1240. X
  1241. X- Added "expression pasting"
  1242. X
  1243. X- Added CAL-type reminders
  1244. X
  1245. X- Added the SATISFY clause
  1246. X
  1247. X- Improved debugging of reminder scripts
  1248. X
  1249. X- Took out the "purge" option - it is in general too dificult to tell when
  1250. X  a reminder has expired for good, so now it's up to you to do this
  1251. X  by hand.
  1252. X
  1253. X- Fixed a lurking bug in trigger date calculation which, amazingly, had not
  1254. X  been caught in the couple of years that Remind has been out!
  1255. X
  1256. X* Version 2.4 Patch 5 - Added the "c+n" option for printing a calendar by
  1257. Xweeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  1258. X
  1259. X* Version 2.3 Patch 4 - Made the init.c file nicer.  Made the Makefile
  1260. Xprettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  1261. X
  1262. X* Version 2.3 Patch 3 - Added a command-line option for Remind to process
  1263. Xqueued reminders in the foreground.  This makes automatic termination
  1264. Xof Remind processes from within X-Windows and Sunview easier.
  1265. X
  1266. X* Version 2.3 Patch 2 - Fixed up a problem with timed reminders which resulted
  1267. Xin cursor not starting from left side of screen on some systems.
  1268. X
  1269. XFixed the SIGINT handler for SYSV systems - this was interrupting the
  1270. Xsleep(2) system call.
  1271. X
  1272. XClosed stdin and stdout if remind was part of a pipe - this prevents other
  1273. Xsections of the pipe from hanging as remind puts itself in the background.
  1274. X
  1275. XAdded the "-h" (Hush mode) option
  1276. X
  1277. XAdded the "%#" and "%@" modifiers for the current time.
  1278. X
  1279. XMade the Makefile more portable
  1280. X
  1281. X* Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
  1282. Xto trigger all non-expired reminders.
  1283. X
  1284. XAdded Turbo C support courtesy of Rhys Weatherly
  1285. X
  1286. XAdded the "RUN ON" and "RUN OFF" commands for a secure interface with
  1287. Xthe Elm mail system.
  1288. X
  1289. XAdded the "rem" shell script for running Remind with a default script.
  1290. X
  1291. XAdded manual pages for "kall" and "rem".
  1292. X
  1293. X* Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
  1294. X
  1295. XAdded the "++" form of 'back' and the "--" form of 'delta' for
  1296. Xignoring OMIT information.
  1297. X
  1298. XAdded the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
  1299. Xkeywords for isolating personal or peculiar reminders from the global
  1300. XOMIT context.
  1301. X
  1302. XSpeeded up the parsing of tokens.
  1303. X
  1304. XChanged the source to recognize and exploit ANSI-C compilers which
  1305. Xaccept function prototypes.
  1306. X
  1307. XAdded the "-n" option to output the next occurrence of each reminder
  1308. Xin SimpleCalendar format
  1309. X
  1310. XModified the calendar and SimpleCalendar formats so that the % escape
  1311. Xsubstitutions ARE performed.
  1312. X
  1313. X* Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
  1314. Xhandling of holidays more sensible.  Also corrected a few more bugs.
  1315. X
  1316. X* Version 2.2 - Patch 3  - Added the MSG or RUN tokens in an OMIT command; also
  1317. Xallowed RUN-type reminders to be explicitly included in the calendar by
  1318. Xusing the %" escape sequence.
  1319. X
  1320. X* Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
  1321. Xcalendar facility.
  1322. X
  1323. X* Version 2.1 - Added the "repeat" token for repeating reminders with a period
  1324. Xother than 7 days.  Also fixed some bugs from version 2.0
  1325. X
  1326. X* Version 2.0 - first public release.  Included advanced date specifications,
  1327. Xcharacter substitution, and the RUN keyword.
  1328. X
  1329. X* Version 1.0 - never publicly released.
  1330. X
  1331. X
  1332. X
  1333. SHAR_EOF
  1334. $TOUCH -am 1109141292 WHATSNEW.30 &&
  1335. chmod 0600 WHATSNEW.30 ||
  1336. echo "restore of WHATSNEW.30 failed"
  1337. set `wc -c WHATSNEW.30`;Wc_c=$1
  1338. if test "$Wc_c" != "3329"; then
  1339.     echo original size 3329, current size $Wc_c
  1340. fi
  1341. fi
  1342. # ============= kall ==============
  1343. if test X"$1" != X"-c" -a -f 'kall'; then
  1344.     echo "File already exists: skipping 'kall'"
  1345. else
  1346. echo "x - extracting kall (Text)"
  1347. sed 's/^X//' << 'SHAR_EOF' > kall &&
  1348. X#!/bin/sh
  1349. X#
  1350. X# kall - kill all processes belonging to this user that match
  1351. X#           specified string.
  1352. X
  1353. Xsignal=`echo $1 | grep '^\-.*'`
  1354. Xme=`basename $0`
  1355. X
  1356. Xif [ "$signal" != "" ]; then
  1357. X    shift
  1358. Xelse
  1359. X    signal="-TERM"
  1360. Xfi
  1361. X
  1362. Xif [ "$1" = "" ]; then
  1363. X    echo "usage: $me [-signal] string [string...]"
  1364. X    echo "       kills all of your processes where command name matches"
  1365. X    echo "       any of the given strings."
  1366. X    exit
  1367. Xfi
  1368. X
  1369. Xmsg="0"
  1370. X
  1371. Xwhile [ "$1" != "" ]; do
  1372. X
  1373. X# NOTE:  You may have to modify the next line, since PS is non-portable.
  1374. X# The 'awk' command picks out the process IDs to pass them on to kill.
  1375. X    rprocs=`ps cx | awk '{if(prog == $NF) print $1}' prog=$1 -`
  1376. X    if [ "$rprocs" != "" ]; then
  1377. X        msg="1"
  1378. X        echo -n "${me}: Sending $signal signal to $1 process(es)"
  1379. X        echo '...'
  1380. X        kill $signal $rprocs
  1381. X    fi
  1382. X    shift
  1383. Xdone
  1384. X
  1385. Xif [ $msg = "1" ]; then
  1386. X    echo "${me}: Done."
  1387. Xfi
  1388. SHAR_EOF
  1389. $TOUCH -am 1109141292 kall &&
  1390. chmod 0700 kall ||
  1391. echo "restore of kall failed"
  1392. set `wc -c kall`;Wc_c=$1
  1393. if test "$Wc_c" != "852"; then
  1394.     echo original size 852, current size $Wc_c
  1395. fi
  1396. fi
  1397. # ============= kall.1 ==============
  1398. if test X"$1" != X"-c" -a -f 'kall.1'; then
  1399.     echo "File already exists: skipping 'kall.1'"
  1400. else
  1401. echo "x - extracting kall.1 (Text)"
  1402. sed 's/^X//' << 'SHAR_EOF' > kall.1 &&
  1403. X.TH KALL 1 "26 February 1991"
  1404. X.UC 4
  1405. X.SH NAME
  1406. Xkall \- kill processes by command name
  1407. X.SH SYNOPSIS
  1408. X.B kall
  1409. X[\-\fIsignal\fR] prog1 [prog2...]
  1410. X.SH DESCRIPTION
  1411. X.B Kall
  1412. Xsends the specified \fIsignal\fR (defaults to \fB-TERM\fR) to all processes
  1413. Xwhose command name is specified on the command line.  For example:
  1414. X.PP
  1415. X.nf
  1416. X    kall -HUP remind foobar
  1417. X.fi
  1418. X.PP
  1419. Xsends a \fBHUP\fR signal to all \fIremind\fR and \fIfoobar\fR programs.
  1420. XNote that \fBkall\fR sends signals only to those processes owned by the
  1421. Xuser invoking \fBkall\fR.
  1422. X.SH AUTHOR
  1423. XDavid F. Skoll
  1424. X.SH BUGS
  1425. X.B Kall
  1426. Xis a sh(1) script and depends on the behaviour of ps(1); thus, it is
  1427. Xnot especially portable.
  1428. X.SH SEE ALSO
  1429. Xremind, rem
  1430. SHAR_EOF
  1431. $TOUCH -am 1109141292 kall.1 &&
  1432. chmod 0600 kall.1 ||
  1433. echo "restore of kall.1 failed"
  1434. set `wc -c kall.1`;Wc_c=$1
  1435. if test "$Wc_c" != "679"; then
  1436.     echo original size 679, current size $Wc_c
  1437. fi
  1438. fi
  1439. exit 0
  1440.  
  1441. exit 0 # Just in case...
  1442.