Using less to view output
Robert T. Repko (R Squared Consultants)
rtr at rsquared.com
Sat May 14 20:16:58 PDT 2005
Believe it or not at 5/14/2005 07:42 PM, Jay R. Ashworth said:
>On Sat, May 14, 2005 at 11:38:40AM -0400, Kenneth Brody wrote:
> > Quoting Robert T. Repko (R Squared Consultants) (Sat, 14 May 2005 11:08:03
> > -0400):
> > > I have the following printer definition setup in one of my clients
> > > filepro config file. This successfully works at other locations but
> > > I am unable to get it to work on this system.
> > >
> > > printer27=ViaFile,nocodes, | cat > /tmp/fpfile$$ ; less /tmp
> > > /fpfile$$ ;rm /tmp/fpfile$$,Send output to /tmp/fpfile$$
> > >
> > > When I run a report the fpfile is created, and removed, but is not
> > > displayed, I am immediately returned to the command prompt or menu. I
> > [...]
> >
> > When filePro closes the printer output, the system will then run less.
> > However, what will less be using to read the keyboard? After all, its
> > stdin has been closed. (I believe that less will open "/dev/tty" in
> > this case, since I know you can pipe things to less.) However, you
> > now have two programs reading from that device -- the program that
> > called *report (in this case, runmenu) will be reading the input
> > device, and so will less.
> >
> > How does this work on other systems? How can you be scrolling through
> > a file within less, while at the same time be interacting with the
> > filePro menu that has been redisplayed?
>
>Because filepro is supposed to send it's output to *the pipeline*,
>which is run by a subshell, and filepro shouldn't get control back
>until the pipeline exits.
>
>I suspect strongly that this depends intimately on the semantics of the
>SYSTEM() system call, and that he might have better luck enclosing the
>pipeline (the series of semicolon-chained commands, which strictly
>speaking is *not* a pipeline) in explicit parenthesis.
>
>Whether that will help *also* depends on the semantics of system; he
>might need to make the string of commands a shell script (which makes
>more sense anyway)...
I tried enclosing all the commands in () which also did not work.
*******************************************************************************
* Robert T. Repko - R Squared Consultants | Voice: (610) 253-2849 *
* Serving the Computing World for 20+ years | Fax: (610) 253-0725 *
* Windows/Unix/Mac Networking, Cisco, Sonicwall | email: rtr at
rsquared.com*
* NJDOE Provider ID#: 763 | SPIN: 143010681 | Address: 4 Juniper Ave. *
* New Jersey SCC Pre-Authorized | Easton, PA 18045 *
*******************************************************************************
More information about the Filepro-list
mailing list