fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[]){
  5. char *w = getenv("EXTRA");
  6. if(!w){
  7. w = getenv("FOOD");
  8. }
  9. if(!w){
  10. w = argv[argc - 1];
  11. }
  12. char *c = getenv("EXTRA");
  13. if(!c){
  14. c = argv[argc - 1];
  15. }
  16. printf("%s with %s\n", c, w);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
./prog with ./prog