1 /* Conditionally execute a command based if the file argv[1] doesn't exist */
2 /* Except for execvp, we stick to ANSI C. */
6 int main(argc
, argv
, envp
)
12 if (argc
< 3) goto Usage
;
13 if ((f
= fopen(argv
[1], "rb")) != 0
14 || (f
= fopen(argv
[1], "r")) != 0) {
18 printf("^^^^Starting command^^^^\n");
19 execvp(argv
[2], argv
+2);
23 fprintf(stderr
, "Usage: %s file_name command\n", argv
[0]);