Re: problem in setting environmental variable

On 03/05/2007 03:59 AM, rameshotn3@xxxxxxxxx wrote:
I am giving export command in script like
system("export ram");

The variable is exported automatically when you set a key in %ENV.

$ENV{ram} = 20;
system ('echo $ram');

system command forking one more child process. So the value becomes temporary.

It will always be temporary.

How can I come out of this problem.
Any help in this regard.

There is no way to do this directly. Read "perldoc -q environment"


Relevant Pages

  • Re: csccmd not running in script
    ... I moved the code around a little so that csccmd runs before anything else ... and I get no echo. ... command to complete so we can retrieve the return code. ... you may need to use "Run as Administrator" when you run the script. ...
  • Re: Why no output display when I input at console
    ... echo running $e: ... There is no output on screen, which is not like that in script file ... After you think you fixed your PATH variable, look at it with the command ...
  • Re: Referencing Korn Shell Array Names as a Variable
    ... Your idea worked for displaying the output from the command. ... $ echo $ ... # Attempt to use variable array name and index to reference array value ... The issue is with this line of the script ...
  • Re: redirect for stdout in ${command_line}
    ... echo "Command line is shown below:" ... # END OF SCRIPT# ... I would accept a variable and build a command line while ... echo "Temp file contents are shown below:" ...
  • Re: Shell scripts: variable assignment within read loops
    ... things) to obtain information from a command, ... echo $foo ... echo "NICs: $nics" ... the script is to be used to gather ...