| wdare_2000@yahoo.com 2005-06-06, 8:58 pm |
| I am trying to come up with a version of the kibitz such that the
person being kibitzed doesn't know. Management wants to spy on certain
people. I am a novice with tcl and expect.
I've done the following:
#!/usr/local/bin/expect
proc mkfifo {f} {
if 0==[catch {exec mkfifo $f}] return ;# POSIX
if 0==[catch {exec mknod $f p}] return
# some systems put mknod in wierd places
if 0==[catch {exec /usr/etc/mknod $f p}] return ;# Sun
if 0==[catch {exec /etc/mknod $f p}] return ;# AIX, Cray
puts "Couldn't figure out how to make a fifo - where is mknod?"
abort
}
catch {exec rm -f /tmp/bill.fifo.out}
mkfifo /tmp/bill.fifo.out
exec chmod 666 /tmp/bill.fifo.out
send "fifo created\n"
#exec /bin/sh "cat -u /tmp/bill.fifo.out >/dev/null &"
spawn -open [open /tmp/bill.fifo.out w]
set userout $spawn_id
spawn aamain.men
set aamain_spawn_id spawn_id
interact {
-output $aamain_spawn_id
}
I thought adding
-input $aamain_spawn_id
-output $userout
in the interact control block would send all output from the aamain
program also to the fifo. However, when I do this the output no longer
goes to the original screen and the program hangs.
Any help would be greatly appreciated.
Bill
|