1 /* Conditionally execute a command based if the file argv[1] doesn't exist */
2 /* Except for execvp, we stick to ANSI C. */
3 # include "private/gcconfig.h"
8 int main(argc
, argv
, envp
)
14 if (argc
< 3) goto Usage
;
15 if ((f
= fopen(argv
[1], "rb")) != 0
16 || (f
= fopen(argv
[1], "r")) != 0) {
20 printf("^^^^Starting command^^^^\n");
22 execvp(argv
[2], argv
+2);
26 fprintf(stderr
, "Usage: %s file_name command\n", argv
[0]);