Did you try simply piping echo?
system ("echo | zsh foo.sh");
I would rather do this than head off down the Expect rabbit hole if it is all that's required.
In reply to Re: Input Enter while Execution of a process
by hippo
in thread Input Enter while Execution of a process
by pratikmonu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |