|
|
1.1 ! root 1: /*************************************************************************** ! 2: * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne. JOVE * ! 3: * is provided to you without charge, and with no warranty. You may give * ! 4: * away copies of JOVE, including sources, provided that this notice is * ! 5: * included in all the files. * ! 6: ***************************************************************************/ ! 7: ! 8: #include <sys/types.h> ! 9: #include <sys/file.h> ! 10: ! 11: #ifndef TEACHJOVE ! 12: # define TEACHJOVE "/usr/lib/jove/teach-jove" ! 13: #endif ! 14: ! 15: #ifndef W_OK ! 16: # define W_OK 2 ! 17: # define F_OK 0 ! 18: #endif ! 19: ! 20: extern char *getenv(); ! 21: ! 22: main() ! 23: { ! 24: char cmd[256], ! 25: fname[256], ! 26: *home; ! 27: ! 28: if ((home = getenv("HOME")) == 0) { ! 29: printf("teachjove: cannot find your home!\n"); ! 30: exit(-1); ! 31: } ! 32: (void) sprintf(fname, "%s/teach-jove", home); ! 33: if (access(fname, F_OK) != 0) { ! 34: (void) sprintf(cmd, "cp %s %s", TEACHJOVE, fname); ! 35: system(cmd); ! 36: } ! 37: (void) execlp("jove", "teachjove", fname, (char *) 0); ! 38: printf("teachjove: cannot execl jove!\n"); ! 39: } ! 40:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.