Fix bugs in x=!cmd; we can't use pexpect at all....
Fix bugs in x=!cmd; we can't use pexpect at all.
pexpect makes the subprocesses format their output for a terminal,
with a mix of spaces, tabs and newlines. This makes it virtually
impossible to then capture their output and do anything useful with it.
Fixed a few other small bugs and inconsistencies in process handling.