Last active
August 3, 2017 02:54
-
-
Save btbytes/0b8025c710aa8447343cc86a1fbd84bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
on Unix the 'main' function in C can also take a 3rd argument, a pointer to the current environment variables. | |
https://www.gnu.org/software/libc/manual/html_node/Program-Arguments.html | |
Via: https://twitter.com/deech/status/892938689927630848 | |
gcc envp.c -o prog | |
*/ | |
#include <stdio.h> | |
int main(int argc, char *argv[], char *envp[]) | |
{ | |
for (size_t i = 0; i < sizeof(envp); i++) | |
{ | |
printf("%s\n", envp[i]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS_HOME=/Users/pgowda/.aws | |
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.V28Aqn6H4u/Render | |
CAML_LD_LIBRARY_PATH=/Users/pgowda/.opam/4.02.3/lib/stublibs | |
DBUS_LAUNCHD_SESSION_BUS_SOCKET=/private/tmp/com.apple.launchd.TyY5jooP1f/unix_domain_listener | |
DISPLAY=/private/tmp/com.apple.launchd.TfvbOMunNM/org.macosforge.xquartz:0 | |
GEM_HOME=/Users/pgowda/.rvm/gems/ruby-2.2.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment