I wrote a C program in Linux to set the values of environment variables using setenv, but I cannot set value for array variable (I printed the value of the array to an output file, but the content of the file is blank), but non-array variables are working fine.
Here is the code snippet:
setenv("header", "Welcome: ", 1); // work fine, can output to file
setenv("info[0]", "192.168.1.1: ", 1); // nothing are shown in output file
setenv("info[1]", "AA-AA-AA-BB-BB-BB: ", 1); // nothing are shown in output file
I cannot find any reason why it not work :( Any help is appreciated.