Solved

Environment Variable from C program

Posted on 1997-11-19
2
206 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 50 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

705 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