Piping data to Linux program which expects a TTY (terminal)

前端 未结 1 582
暖寄归人
暖寄归人 2020-11-30 06:08

I have a program in Linux which refuses to run if its stdin/stdout is not a TTY (terminal device). Is there an easy-to-use tool which will create a PTY, start the program wi

相关标签:
1条回答
  • 2020-11-30 06:44

    unbuffer, part of expect (sudo apt-get install expect-dev on Ubuntu Lucid), can fool a program into thinking it's connected to a TTY.

    $ tty 
    /dev/pts/3
    $ echo | tty 
    not a tty
    $ echo | unbuffer tty 
    /dev/pts/11
    
    0 讨论(0)
提交回复
热议问题