[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: example implementation (was: Re: DRAFT: Fixing the architecture query options of dpkg.



On Mon, Jan 11, 1999 at 10:09:15AM +0000, Jules Bean wrote:
> On Sun, 10 Jan 1999, Marcus Brinkmann wrote:
> > Question: Can I modify the environment of the invoking shell from inside a
> > perl script? This would make it easier to use the script.
> 
> Nope.
> 
> (This is more or less fundamental to the way environment variables work).

okay. This is the same answer as Wicherts. I was afraid that it is so.
 
> The standard approach is to eval the output of a program.  c.f. 
> 
> eval `ssh-add`
> 
> as used by ssh.

I will suggest something like this in the documentation then.

I was a bit surprised that the following does not work:

#!/bin/sh
# output
echo ABC=abc

#!/bin/sh
# trial
echo $ABC

flora:/tmp# `sh output` sh trial
bash: ABC=abc: command not found
flora:/tmp# sh `sh output` sh trial
ABC=abc: ABC=abc: No such file or directory

But:
flora:/tmp# ABC=abc sh trial
abc

Marcus

-- 
"Rhubarb is no Egyptian god."        Debian GNU/Linux        finger brinkmd@ 
Marcus Brinkmann                   http://www.debian.org    master.debian.org
Marcus.Brinkmann@ruhr-uni-bochum.de                        for public  PGP Key
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       PGP Key ID 36E7CD09


Reply to: