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"
11 int main(argc
, argv
, envp
)
19 #endif /* __DJGPP__ */
20 if (argc
< 3) goto Usage
;
21 if ((f
= fopen(argv
[1], "rb")) != 0
22 || (f
= fopen(argv
[1], "r")) != 0) {
27 if ((d
= opendir(argv
[1])) != 0) {
32 printf("^^^^Starting command^^^^\n");
34 execvp(argv
[2], argv
+2);
38 fprintf(stderr
, "Usage: %s file_name command\n", argv
[0]);