现在的位置: 首页 > 综合 > 正文

非缓存 重定向到文件(未验证,仅作标记)

2018年05月11日 ⁄ 综合 ⁄ 共 391字 ⁄ 字号 评论关闭

http://bbs.chinaunix.net/thread-1500656-1-1.html


unbuffer ./prog >logfile &

[waker@proxy ~]$ cat $(which unbuffer)
#!/bin/sh
# \
exec expect -- "$0" ${1+"$@"}
# Description: unbuffer stdout of a program
# Author: Don Libes, NIST

if {[string compare [lindex $argv 0] "-p"] == 0} {
    # pipeline
    set stty_init "-echo"
    eval spawn -noecho [lrange $argv 1 end]
    interact
} else {
    set stty_init "-opost"
    eval spawn -noecho $argv
    set timeout -1
    expect
}

抱歉!评论已关闭.