Skip to content

Instantly share code, notes, and snippets.

@DavidEGrayson
Created September 18, 2017 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidEGrayson/e87cb1631ab113ed1c9a86eb97a9ab2e to your computer and use it in GitHub Desktop.
Save DavidEGrayson/e87cb1631ab113ed1c9a86eb97a9ab2e to your computer and use it in GitHub Desktop.
$ cat test.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char ** argv)
{
for(int i = 0; i < argc; i ++)
{
printf("%d = %s\n", i, argv[i]);
}
printf("PYTHONPATH = %s\n", getenv("PYTHONPATH"));
return 0;
}
$ TEST_DIR=./
$ PYTHONPATH="${TEST_DIR}input:${TEST_DIR}"
$ export PYTHONPATH
$ gcc test.c -o test_args
$ ./test_args ./:./input
0 = C:\Users\David\Documents\scraps\test_c_args\test_args.exe
1 = .\;.\input
PYTHONPATH = .\input;.\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment