cc: [email protected]
Subject: Re: 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.


A subshell parses the complete subshell before executing it
so there is not way to do
        enter_subshell();
        do_command(1);
        do_command(2);
        exit_subshell();


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

Reply via email to