Skip to content

Instantly share code, notes, and snippets.

@soasme
Created July 20, 2013 04:41
Show Gist options
  • Save soasme/6043900 to your computer and use it in GitHub Desktop.
Save soasme/6043900 to your computer and use it in GitHub Desktop.
man 3 getenv
/tmp % cat env.c
#include <stdlib.h>
#include <stdio.h>
int
main(int argv, char **args) {
printf("%s", getenv("PATH"));
}
/tmp % llvm-gcc -o env env.c
/tmp % ./env
/Users/soasme/.rvm/gems/ruby-1.9.3-p392/bin:/Users/soasme/.rvm/gems/ruby-1.9.3-p392@global/bin:/Users/soasme/.rvm/rubies/ruby-1.9.3-p392/bin:/Users/soasme/.rvm/bin:/usr/local/bin:/usr/local/sbin:/usr/local/git/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Postgres.app/Contents/MacOS/bin:/usr/local/share/npm/bin:/usr/local/go/bin:/usr/local/texlive/2012/bin/x86_64-darwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment