in reply to shell variables with Perl
Case 2 - If you have a shell script that calls a Perl script to permanently set environment variable, and then run another program:$ENV{DISPLAY} = "10.16.119.3:0.0"; `another_program`;
And then in your shell script, you do this:print "export DISPLAY=$display_value\n";
#!/usr/bin/bash # Create a temporary shell script using perl perl_program.pl > /tmp/setenv.$$ # source the temporary script and then remove it . /tmp/setenv.$$ rm -f /tmp/setenv.$$ # run another program with the modified environment another_program
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: shell variables with Perl
by iburrell (Chaplain) on Sep 23, 2003 at 17:25 UTC |