Re: Can I use a pipe fit with DBSCREENOUT
Posted in 1993
Topics: Installation, Setup & Upgrades
In article <1993Mar5.174746.2004@netcom.com> bobb@netcom.com (Bob Beaulieu) writes: >In article <1993Mar5.023250.12310@glh.uucp>, hgary@glh.uucp (Gary L. Hale) writes: >> I posted an article about two weeks ago (No response) asking if anyone >> has any info on $DBSCREENOUT. I want to use the output >> to go to a printer vice a file? >> >> Does anyone know what I am talking about ($DBSCREENOUT)? > > >I haven't heard of DBSCREENOUT, what do you know about it? > >I have heard about DBSCREENDUMP, which is an undocumented environmental >variable that prints a copy of the screen to an 'outfile' specified each >time a '^P' is pressed. > >In your .profile should include: > >DBSCREENDUMP=./screen.out >export DBSCREENDUMP > >After reading you .profile and while within an Informix Database, if you >press '^P' a copy of the screen (almost copy I should say) is written to >a file named 'screen.out'. Of course, while in the menuing system or in the >interactive mode of a form you could print the contents of the 'outfile' >by typing: > >!lp screen.out > >I have tried making a pipe out of 'screen.out' first: > >mknod screen.out p > >But, can not seem to link the data flowing thru the pipe to the lp. Can >you think of a way to do this. Sure, that's easy. You need something that sits around reading the pipe. Nohup the following script and put it in the background. #!/bin/sh while [ true ] do lpr < ${DBSCREENBDUMP} done # End of script Of course you may have to modify this slightly depending on the specifics of your installation. (E.g., lp instead of lpr.) The instance of lpr (lp) will wait until it gets a file and complete when it recognizes an EOF; then the next iteration of the infinite loop sits on the pipe and waits for the next file. Naturally a little coding in C would make this more elegant, but this is the essence of a quick and dirty script that I use. Tom Seeba