home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sources / misc / 4074 < prev    next >
Encoding:
Text File  |  1992-11-09  |  37.2 KB  |  1,450 lines

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