Solved

Setting the Environment varable

Posted on 2000-03-06
5
152 Views
Last Modified: 2013-12-25
From My CGI Program I want to set an Environment Variable named METAMAIL_TMPDIR. I have used

putenv("METAMAIL_TMPDIR=/home/tst/tmp");

it dint work.

I also used

system("export "METAMAIL_TMPDIR=/home/tst/tmp");

but this also does'nt work.


Can any body give me a solution.


Thanks in advance
0
Comment
Question by:LotsOfQuestions
5 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2587743
whats it written in C perl ????????????//
0
 
LVL 10

Expert Comment

by:makerp
ID: 2587749
what OS
0
 
LVL 16

Expert Comment

by:maneshr
ID: 2588520
try this

$ENV{'METAMAIL_TMPDIR'}="/home/tst/tmp";

0
 
LVL 1

Expert Comment

by:ercis
ID: 2594347
I'm not sure that environment variable that you set from CGI, will stay after CGI quits ...
0
 

Accepted Solution

by:
wawb earned 50 total points
ID: 2602779
From the Perl FAQ:

I {changed directory, modified my environment} in a perl script. How come the change
disappeared when I exited the script? How do I get my changes to be visible?

Unix

     In the strictest sense, it can't be done -- the script executes as a different process from the shell it was started from. Changes to a process are not
     reflected in its parent, only in its own children created after the change. There is shell magic that may allow you to fake it by eval()ing the script's
     output in your shell; check out the comp.unix.questions FAQ for details.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Update a File not in all folders 2 46
How to count json data 2 76
Windows Script Host failed (Access is denied.) error 6 146
How does Redux fit into React? 3 79
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

776 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