Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!wuarchive!uunet!cme!libes From: libes@cme.nist.gov (Don Libes) Newsgroups: comp.unix.programmer Subject: Re: Two paths for one file descriptor Message-ID: <11253@muffin.cme.nist.gov> Date: 19 Feb 91 21:10:25 GMT References: <3814@wb3ffv.ampr.org> Organization: National Institute of Standards and Technology Lines: 21 In article <3814@wb3ffv.ampr.org> wmark@wb3ffv.ampr.org (Mark Winsor) writes: >I need the ability within a curses based program to be able to send the >standard output to two different terminals upon receipt of a SIGUSR1. The >purpose of this is to enable remote viewing via modem of what a user is >doing WITHOUT requiring them to get out of the application. Anybody have >any suggestions? I realize that most solutions will require that the >local and remote terminals are the same type (which is not a problem). Any >ideas would be appreciated. If you have expect (see comp.unix.questions FAQ), you can do this with the following script: trap {log_file another-terminal} SIGUSR1 spawn curses-based-program interact You can jam this all on the command line without the script as: expect -c "trap {log_file file} SIGUSR1; spawn program; interact" Don Libes libes@cme.nist.gov ...!uunet!cme-durer!libes