RE: man redirect error

2012-01-06 Thread Nellis, Kenneth
On Wed, 2012-01-04 at 08:51 -0600, Thrall, Bryan wrote:

 Perhaps the OP was looking for something like apropos or whatis?
 
 snip/

In this case, the OP was simply using head as an example to
show how piping the output of man was generating an unexpected
error. As you all know, Unix is rich in text processing tools,
so it shouldn't be a surprise that one might want to do some
processing of man output. Further experimentation with piping
man output suggests that the error presents itself when the
process receiving the man output stream terminates (as with 
head) before man is done writing it.

--Ken Nellis


Re: man redirect error

2012-01-04 Thread Reid Thompson
On Tue, 2012-01-03 at 15:30 -0600, Nellis, Kenneth wrote:
 Thought maybe someone would be interested in the following error.
 
 $ man gcc | head
 GCC(1)GNU
 GCC(1)
 
 
 
 NAME
gcc - GNU project C and C++ compiler
 
 SYNOPSIS
gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] [-Olevel]
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip
 -c '/usr/share/man/man1/gcc.1.gz') | /usr/bin/tbl | /usr/bin/nroff -c
 -mandoc 2/dev/null | /usr/bin/less -isrR) exited with status 36096.
 No manual entry for gcc
 $


probably not.  Why are you wanting to head the output?  Man already
displays using a pager.

$ uname -a
Linux raker2 2.6.39-gentoo-r3 #7 SMP PREEMPT Thu Nov 17 16:11:22 EST
2011 x86_64 Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz GenuineIntel
GNU/Linux

$ man gcc |head
GCC(1)GNU
GCC(1)



NAME
   gcc - GNU project C and C++ compiler

SYNOPSIS
   gcc [-c|-S|-E] [-std=standard]
   [-g] [-pg] [-Olevel]
Error executing formatting or display command.
System command (cd /usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/man
 (echo .pl 11i; /bin/bzip2 -c -d
'/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/man/man1/gcc.1.bz2')
| /usr/bin/gtbl | /usr/bin/nroff -mandoc | /usr/bin/less) exited with
status 141.
No manual entry for gcc


RE: man redirect error

2012-01-04 Thread Thrall, Bryan
Reid Thompson wrote on 2012-01-04: 
 On Tue, 2012-01-03 at 15:30 -0600, Nellis, Kenneth wrote:
 Thought maybe someone would be interested in the following error.
 
 $ man gcc | head
 GCC(1)GNU
 GCC(1)
 
 
 
 NAME
gcc - GNU project C and C++ compiler
 SYNOPSIS
gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] [-Olevel]
 Error executing formatting or display command.
 System command (cd /usr/share/man  (echo .pl 11i; /usr/bin/gunzip
 -c '/usr/share/man/man1/gcc.1.gz') | /usr/bin/tbl | /usr/bin/nroff -c
 -mandoc 2/dev/null | /usr/bin/less -isrR) exited with status 36096.
 No manual entry for gcc
 $
 
 
 probably not.  Why are you wanting to head the output?  Man already
 displays using a pager.

Perhaps the OP was looking for something like apropos or whatis?

Given that man already pipes its output through a pager, the OP could just use 
the MANPAGER environment variable to do what he wants:

$ MANPAGER=head man gcc
GCC(1)GNU   GCC(1)



NAME
   gcc - GNU project C and C++ compiler

SYNOPSIS
   gcc [-c|-S|-E] [-std=standard]
   [-g] [-pg] [-Olevel]

Hope this helps,
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com




RE: man redirect error

2012-01-04 Thread Reid Thompson
On Wed, 2012-01-04 at 08:51 -0600, Thrall, Bryan wrote:

 Perhaps the OP was looking for something like apropos or whatis?
 
 Given that man already pipes its output through a pager, the OP could just 
 use the MANPAGER environment variable to do what he wants:
 
 $ MANPAGER=head man gcc
 GCC(1)GNU   GCC(1)
 
 
 
 NAME
gcc - GNU project C and C++ compiler
 
 SYNOPSIS
gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] [-Olevel]
 
 Hope this helps,
 --
 Bryan Thrall
 Principal Software Engineer
 FlightSafety International
 bryan.thr...@flightsafety.com
 
 

http://cygwin.com/cgi-bin2/package-grep.cgi?grep=apropos



RE: man redirect error

2012-01-04 Thread Thrall, Bryan
Reid Thompson wrote on 2012-01-04: 
 On Wed, 2012-01-04 at 08:51 -0600, Thrall, Bryan wrote:
 Perhaps the OP was looking for something like apropos or whatis?
 
 Given that man already pipes its output through a pager, the OP could
 just use the MANPAGER environment variable to do what he wants:
 
 http://cygwin.com/cgi-bin2/package-grep.cgi?grep=apropos

Yes, I know :-)

I was trying to suggest apropos might be what the OP was trying to find while 
also providing a literal solution to his problem.
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com