Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Environment Variable from C program

Posted on 1997-11-19
2
Medium Priority
?
209 Views
Last Modified: 2010-04-21
I would like to export a shell variables from a C program but
when program exits variable is not set. Is somebody has an idea ?
0
Comment
Question by:pla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
xilef earned 150 total points
ID: 2007900
This does not work, because every process has its own environment. As soon as your process exits, its environment is gone.

More information can be found in the UNIX Programming FAQ: http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC7

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 2007901
It's not easy, but it's not impossible.
exec program :-)
(of course you need additional hacking in your C code to get
work, even as one would expect it working)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question