/* envaddr.c */ #include #include //first create MYSHELL environment variable: export MYSHELL="/bin/sh" int main() { char *shell = (char *)getenv("MYSHELL"); if(shell){ printf(" Value: %s\n", shell); printf(" Address: %x\n", (unsigned int)shell); } return 1; }