------------------------------------------------ On Fri, 17 Oct 2003 11:43:51 -0700, "LoBue, Mark" <[EMAIL PROTECTED]> wrote:
> > > There is no way I know of for a child process to modify the > > environment of > > > it's parent. You might try having your perl program create a script > > > somewhere in the path, then the parent could execute it. > > > > > > You can also get tricky by running your perl script in the current > > > environment using: > > > . program_name (space after the dot) > > > then your program could exit using exec('path/to/shell'); > > > > > > -Mark > > > > > > > I am not sure I understood the OP but I would go with the > > wrapping approach in the other direction, that is, write a > > shell script that sets up the environment, etc. by calling > > the perl script within it. Then run the shell script rather > > than the perl script.... > > > > I don't understand the difference here. Even in a wrap, the perl script has > to be called in the same environment as the wrap, since it is the perl > script doing the mods, using the dot notation, if not, the perl script will > never modify the environment. Correct, or do I still not get it? > Again I am not sure I understood your solution or the OP's question (rather than being cryptic about this command and that alias, and this script, etc. it might be more helpful to have what is actually trying to be accomplished without the cloak and dagger stuff), but I was thinking along the lines of: set_environment.sh: alias name=`/path/to/my/script.pl` script.pl: print "command -i -want -to run"; I am also not sure whether the backticks will work in the shell to properly catch the command like that, but there should be some combination of the shell syntax with the return value from perl that would work. Then you would run the shell script which can edit the current environment, it would call the Perl script to get the value of what it should actually set. This way you don't have to know the path to the shell to exec it, etc. http://danconia.org -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]