------------------------------------------------
On Fri, 17 Oct 2003 10:21:59 -0700, "LoBue, Mark" <[EMAIL PROTECTED]> wrote:

> > -----Original Message-----
> > From: Harter, Douglas [mailto:[EMAIL PROTECTED]
> > Sent: Friday, October 17, 2003 8:09 AM
> > To: Beginners Mailing List Perl (E-mail)
> > Subject: alias in the shell
> > 
> > 
> > Is it possible to create an alias in the shell from within Perl?
> > 
> > I have a command I want to use in the shell after my Perl 
> > script executes. This command can vary, so what I would 
> > prefer to do is set up an alias to execute it. 
> > 
> > I realize aliases are created differently in different 
> > shells. I will be using Bourne.
> > 
> > So far I have tried using system("alias name=xxx")
> > and creating a scipt with the same command in it and 
> > executing it thru system.
> > 
> > Neither worked, since I could not see the new alias by doing
> > alias
> > 
> 
> 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....

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to