Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | #!/bin/sh |
2 | # \ | |
3 | exec expect -- "$0" ${1+"$@"} | |
4 | # Description: unbuffer stdout of a program | |
5 | # Author: Don Libes, NIST | |
6 | ||
7 | if {[string compare [lindex $argv 0] "-p"] == 0} { | |
8 | # pipeline | |
9 | set stty_init "-echo" | |
10 | eval spawn -noecho [lrange $argv 1 end] | |
11 | close_on_eof -i $user_spawn_id 0 | |
12 | interact { | |
13 | eof { | |
14 | # flush remaining output from child | |
15 | expect -timeout 1 -re .+ | |
16 | return | |
17 | } | |
18 | } | |
19 | } else { | |
20 | set stty_init "-opost" | |
21 | set timeout -1 | |
22 | eval spawn -noecho $argv | |
23 | expect | |
24 | } |