Solved

Environment Variable from C program

Posted on 1997-11-19
2
193 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
2 Comments
 

Accepted Solution

by:
xilef earned 50 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
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.:
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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now