Skip to content

Instantly share code, notes, and snippets.

@fakessh
Created September 23, 2012 01:35
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 fakessh/3768475 to your computer and use it in GitHub Desktop.
Save fakessh/3768475 to your computer and use it in GitHub Desktop.
path mv
#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