Created
September 23, 2012 01:35
-
-
Save fakessh/3768475 to your computer and use it in GitHub Desktop.
path mv
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
#include <stdio.h> | |
#include <stdlib.h> /* pour utiliser getenv */ | |
int main(void) | |
{ | |
char *path, *home, *nouveaupath; | |
char assignation[150]; | |
path = getenv("PATH"); | |
home = getenv("HOME"); | |
printf("ancien PATH : %s\net HOME : %s\n", | |
path, home); | |
sprintf(assignation, "PATH=%s:%s/bin", path, home); | |
putenv(assignation); | |
nouveaupath = getenv("PATH"); | |
printf("nouveau PATH : \n%s\n", nouveaupath); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment