leave +nnnn doesn't work at all
ado at elsie.UUCP
ado at elsie.UUCP
Sat Aug 4 02:03:44 AEST 1984
Before we leave the subject, here are our local changes to the "leave.c" source
as distributed with 4.1BSD.
1. A mildly sexist comment has been removed.
2. You are reminded of when you want to leave,
rather than of when you have to leave.
3. You can use a command like
leave 1700 go to the bank
to get a reminder of both when to leave and why.
Lines from the current source file follow.
#ifdef OLDVERSION
static char *sccsid = "@(#)leave.c 4.1 (Berkeley) 10/1/80";
#include <stdio.h>
/*
* leave [hhmm]
*
* Reminds you when you have to leave.
* Leave prompts for input and goes away if you hit return.
* It nags you like a mother hen.
*/
#else
static char sccsid[] = "@(#)leave.c 1.3";
#include <stdio.h>
/*
* leave [hhmm [reminder ...]]
*
* Reminds you when you want to leave.
* Leave prompts for input and goes away if you hit return.
* It nags you.
*/
int argcsaved;
char ** argvsaved;
#endif
.
.
.
#ifdef OLDVERSION
if (argc < 2) {
printf("When do you have to leave? ");
fflush(stdout);
buff[read(0,buff,sizeof buff)] = 0;
} else {
strcpy(buff,argv[1]);
}
#else
#include <ctype.h>
if (argc < 2) {
register char * cp;
static char * fakeargv[1];
argcsaved = 0;
printf("When do you want to leave? ");
fflush(stdout);
buff[read(0,buff,sizeof buff)] = 0;
for (cp = buff; *cp != '\0'; ++cp)
if (!isdigit(*cp)) {
argcsaved = 1;
argvsaved = fakeargv;
fakeargv[0] = cp + 1;
break;
}
} else {
strcpy(buff,argv[1]);
argcsaved = argc - 2;
argvsaved = argv + 2;
}
#endif
.
.
.
#ifdef OLDVERSION
printf("usage: %s [hhmm]\n",argv[0]);
#else
printf("usage: %s [hhmm [reminder ...]]\n",argv[0]);
#endif
.
.
.
#ifdef OLDVERSION
printf("usage: %s [hhmm]\n",argv[0]);
#else
printf("usage: %s [hhmm [reminder ...]]\n",argv[0]);
#endif
.
.
.
#ifdef OLDVERSION
msg1 = "You have to leave in 5 minutes";
#else
msg1 = "You want to leave in 5 minutes";
#endif
.
.
.
#ifdef OLDVERSION
printf("%s\n",msg);
#else
printf("%s",msg);
if (argcsaved > 0) {
register argnum;
printf("--");
for (argnum = 0; argnum < argcsaved; ++argnum) {
printf("%s",argvsaved[argnum]);
if (argnum != argcsaved - 1)
printf(" ");
}
}
printf("\n");
#endif
And here are lines from the current manual page file:
leave \- remind you when you want to leave
.ig
leave \- remind you when you have to leave
..
.SH SYNOPSIS
.B leave
[ hhmm [ reminder ... ] ]
.ig
[ hhmm ]
..
.SH DESCRIPTION
.I Leave
waits until the specified time, then reminds you that you
want to leave.
.ig
have to leave.
..
.
.
.
.PP
If you give a
.IR reminder ,
it is made part of the message.
.PP
If no argument is given,
.I leave
prompts with "When do you
want to leave?". A reply of newline causes
.ig
have to leave?". A reply of newline causes
..
--
...decvax!allegra!umcp-cs!elsie!ado (301) 496-5688
(DEC, VAX and Elsie are Digital Equipment Corp. and Borden's trademarks)
More information about the Comp.unix.wizards
mailing list