help-bash
[Top][All Lists]
Advanced

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

Re: sub-process changing value available to parent process?


From: Jasper
Subject: Re: sub-process changing value available to parent process?
Date: Sun, 05 Apr 2020 12:33:18 +0200
User-agent: XS4ALL Webmail

Sylvain Viart schreef op 2020-04-05 08:55:
Hi,

This idea come back again. I would like to be able to modify bash
variable from a child program.

As the child program has no access to parent's variable space, one
solution is that the child-program
ouputs bash valid code and the parent script uses eval() so the current
env is modified.

We see this behavior when using ssh-agent for example.

I would like to be able to pass modified value to the shell parent
without using eval.

What shared environment could I use to ensure safe and efficient
communication from a sub program with it's parent script?


Regards,
Sylvain.

Hi,

to me that is: parent_var=$( whatever the child has as output )

Or is that not what you are after ?

Jasper



reply via email to

[Prev in Thread] Current Thread [Next in Thread]