Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Without looking at the code, I'd guess these two issues are actually just symptoms of the same problem. It will be down to the way you're shell executing your commands.

Python isn't my strongest language, but there will be other ways to launch an external process while forwarding STDERR / STDOUT streams in real time. Maybe instead of forking a shell, run the command as a process. You can still execute from within a shell using -c flag, eg

    $ bash -c 'export a=$(echo "hello world"); echo $a'
    hello world
    $ echo $a # demonstrates that the envs aren't passed backwards

    $
If you do this then you need to be careful about your quotes / escaping. But it would still be less work than reinventing a Bash script parser.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: