C程序:(文件名:temp.c)
main ()
{
putenv ("VERSION");
setenv ("VERTSION","1.0",1);
printf ("%s\n\r",getenv ("VERSION");
exit (0);
}
Cprogram的输出: 1.0
=============================================== ===========
Bash脚本:
./temp
echo "Ver from bash:"$VERSION
输出bashscript:
1.0 **(from c program)**
Ver from bash: **(from bash shell, why wont $VERSION get output here?)**