1 /* Stops you from accidentally running crontab -r. alias this to crontab.
2 Alternatively, if you are on a GNU system, you can just alias "crontab -r" to
3 "crontab -ri", but this isn't POSIX. */
9 int main(int argc, char *argv[]) {
10 char arg[255] = "crontab ";
12 for (int i = 1; i < argc; i++) {
13 strcat(arg, strcat(argv[i], " "));
16 if (strstr(arg, "-r") != NULL) {
17 printf("%s", "Delete user's crontab? [yes/no]: ");
21 ret = scanf("%s", inp);
22 if (ret == EOF) continue;
23 else if (strcmp(inp, "no") == 0) exit(0);
24 else if (strcmp(inp, "yes") == 0) break;
25 else printf("%s", "Please answer yes or no. [yes/no]: ");