Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: gjw@spurr.wr.usgs.GOV (Gregory J. Woodhouse) Newsgroups: comp.windows.x Subject: Re: xterm/dxterm selection into pipe? Message-ID: <9101301658.AA03040@spurr.wr.usgs.gov> Date: 30 Jan 91 16:58:50 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 24 >I would like to be able to pipe the contents of the highlighted >selection in a terminal window (xterm or dxterm) into various commands, >principally lpr. This would give me a "print selection" capability. Any >solutions out there? BTW, I am running ultrix 4.0 / DECwindows, but I >have the R4 clients. > >Forgive me if this is a simple question - I have checked the FAQ without >success. > >-- >erik sowa (sowa@amdew.llnl.gov,sowa@cms1.llnl.gov) > Well...Once the text is selected, you can copy it into a string using XGetWindowProperty(), then your application should set up a pipe, and fork of a copy of lpr. (You need to arange that the display connection close across execs.) Then, you just write the string onto the pipe. Gregory Woodhouse gjw@ags.wr.usgs.gov P.S. If you send me mail, I can explain the details of how to do all of this.