executing a shell script from C
bit of an obscure question, but here goes...
is there any way of executing a shell script inside a C program, and then accessing the enviroment of that shell script using getenv()?
e.g., if i had the script
could i execute it within my program and then find the value assigned to variable?
i know you can execute programs with the call
so considering shell scripts have xcutable permission you could go along that line. I really don't know if this is what your after or not though.
I think if you export the vars in the shell that you create it may work, but I've never done it that way. Unless you are really stuck on using the env vars, I'd suggest that you use popen and get the output of the script via a pipe.
|All times are GMT -5. The time now is 02:04 AM.|