On Mon, Jun 11, 2012 at 4:09 PM, Irek Szczesniak <[email protected]> wrote:
> On Mon, Jun 11, 2012 at 4:03 PM, David Korn <[email protected]> wrote:
>> cc: [email protected]
>> Subject: Re: [ast-developers] libshell C API to begin subshell?
>> --------
>>>
>>> Is there any public C API to begin a subshell? I'd like to create a
>>> subshell and run several commands through sh_run() and then let either
>>> end the subshell through a sh_run() executing exit() or by providing
>>> another C API call to end it.
>>>
>>> Irek
>>
>> Not directly, but after calling sh_init(), if you call
>>        exitval = sh_trap("(command...)",0)
>> it should run command in a subshell.
>
> That doesn't help in our case because sh_trap() requires that the
> whole command chain must be known and available before calling it. But
> we want to run multiple commands in a subshell and stay in that
> subshell between sh_run() calls. The number and arguments to sh_run()
> may vary depending on the results we get between the calls.

Does it help if you could use something like |sh_trap("( cmd1 )", ...)
... sh_trap("( cmd2 )", ...) ... sh_trap("( cmd3 )", ...) ...| ?
Otherwise we'll need a new API in libshell (well, I could see some
usage for it).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to