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

Or you could just disable buffering, for instance with the unbuffer tool that comes with Expect:

    ./mytest | tee out.txt # blocks of Hello. and Hi.
    unbuffer ./mytest | tee out.txt # expected result


Without looking at it's source, what 'unbuffer' does is likely allocate a PTY for the things under it. That's how the rest of Expect works after all ;)




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

Search: