csci4061/notes/03-process-basics-code/environment_vars.c~
Michael Zhang 041f660ccd
f
2018-01-29 17:28:37 -06:00

18 lines
364 B
C

#include <stdlib.h>
int main(int argc, char *argv[]){
char *verbosity = getenv("VERBOSITY");
if(verbosity == NULL){
printf("VERBOSITY not set\n");
return 0;
}
else{
printf("VERBOSITY is %s\n\n",verbosity);
printf("Turning VOLUME to 11\n");
int fail = setenv("VOLUME","11",0);
if(fail){
printf("Couldn't change VOLUME