Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting the Environment varable

Posted on 2000-03-06
5
Medium Priority
?
157 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
[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
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 100 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

722 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