Thanks to all who responded and gave me the solutions I needed. After
seeing the responses, I really wanted to hit my head against the wall for
being so blind.
I received from the following people:
rene@iusti.univ-mrs.fr (Mr Rene Occelli)
Torsten Metzner <tom@math.uni-paderborn.de>
Robert.Gillespie@waii.com (Robert.Gillespie@waii.com)
Terry Gorby <tgorby@emc.com>
tim.newman@amp.com (Tim Newman)
dennis.evans@amp.com (Dennis Evans)
rloftin@engsys.mc.xerox.com (Ron Loftin)
Michael Wright <michael.wright@medaphis.com
(insert any others I might have missed)
Most were right on the money and reminded me to use /usr/openwin/bin/xv_get_sel
instead of get_selection. A few sent me exactly what they used in their
menus.. You would think I would have realized this since I use it in another
script which I use on both solaris and sunos boxes (*insert sound of dumb
sys-admin slapping his forehead with biggest book he can find*)...
Sample solutions:
"Print Selection" ( xv_get_sel 1 | lpr ;echo '' ) /* print selected text */
"Print Clipboard" ( xv_get_sel 3 | lpr; echo ) /* print clipboard */
"Print Selected Text" sh -c "xv_get_sel | lp ; echo 'Selection printed'."
"Print window" exec xwd | xpr -device ps -portrait -top 1 | lp
"Print window Rev" exec xwd | xpr -device ps -rv -portrait -top 1 | lp
"Print Selected Text" sh -c "xv_get_sel | fold | lpr ; echo 'Selection Printed..'."
A few people even sent me some scripts that do the above as well.
Thanks a bunch for the responses guys..
-Greg
************** ORIGINAL MESSAGE ***************************************
Hi oh knowledgable ones...
On our sunos systems, I had a menu selection that allowed a user to
highlight text and dump the highlighted text straight to a printer. The
script I used for this was
sh -c "get_selection | lpr -h; echo 'Selection printed'."
get_selection was a program located in /usr/bin and was from SunViews
optional software.
Having several of our users now on solaris2, they are screaming for the same
functionalitly, and alas, get_selection doesnt exist nor work in binary compat
mode on the solaris2 boxes. Does anyone know of another method to achieve
dumping highlighted text to a printer that will work on solaris2?
Btw, I did try simply copying get_selection over to the solaris2 boxes, but
it gives an error:
lpr: lw: unknown printer/class
Selection printed.
ld.so.1: /usr/local/bin/get_selection: fatal: libsuntool.so.0.54: can't open file: errno=2
Any ideas? (Like how to simulate the "copy" key in a script?)
Thanks in advance...
ps. this are ultras running solaris 2.5
/------------------------------------------------------------------------------\
* Greg Harrison | "Well, that is one of the most *
* System Administrator | well documented, non-working pieces *
* Analog Devices | of code I have ever written" *
* 7910 Triad Center Drive | -Anonymous *
* Greensboro, NC 27409 | For reply, send a self-abused *
* (910) 605-4359 | stomped antelope to *
* email: greg.harrison@analog.com | greg.harrison@analog.com *
\------------------------------------------------------------------------------/
***************************************************************************
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:11 CDT