The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
pipe broken abir2 UNIX and Linux Applications 1 12-26-2007 11:40 PM
pipe broken abir2 Linux 2 12-26-2007 08:48 PM
Broken Pipe ramkrix UNIX for Advanced & Expert Users 1 12-08-2007 05:29 AM
broken pipe eloquent99 UNIX for Dummies Questions & Answers 3 03-11-2003 10:18 PM
broken pipe? gusla UNIX for Dummies Questions & Answers 3 05-12-2002 02:05 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-08-2007
Registered User
 

Join Date: Dec 2007
Location: TamilNadu,INDIA
Posts: 46
Unhappy Broken Pipe

Hi
I tried to open the man page of sh and piped to `pg`. Normally while reading a file page by page using `pg`, if we wanna quit at the middle of file, we give "q" near the colon mode.

Ex1: $cat file1 | pg
hi
how
r
u
:
(page1) now press "return key", it will go to next page
yes
i
am
fine
: q
(I wanna quit here and I gave q and its quit from the process normally)
$


The above mentioned condition is normal

My case is:

$ man sh | pg
User Commands sh(1)



NAME
sh, jsh - standard and job control shell and command inter-
preter

SYNOPSIS
/usr/bin/sh [-acefhiknprstuvx] [argument...]

--------- goes on

: q
(now if i give q here, its showing error "BROKEN PIPE")

why in normal case mentioned in example 1 its not happening, while in man sh|pg its happening (broken pipe)?

Please help me on this with clear explanation?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-08-2007
Moderator
 

Join Date: Dec 2003
Location: /ksh93
Posts: 883
Are your man pages preformatted i.e. are your cat subdirectories populated? If not, the man utility often uses pipes to create the output you see from the nroff or sgml sources.
Reply With Quote
  #3 (permalink)  
Old 12-09-2007
Registered User
 

Join Date: Dec 2007
Location: TamilNadu,INDIA
Posts: 46
Question

Hi fpmurphy/all,
how to check whether my man pages are preformatted or how can I check my cat subdirectories populated?

For your info, its not my man page automatically piping it with pg. I have done it done as I shown in my First post. Plz go thro tat once again..

Thanks..
Reply With Quote
  #4 (permalink)  
Old 12-09-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
I don't see anything to worry about.

Broken pipe is the message you get from EPIPE which is the error you get if a write is attempted on a pipe where the read end is closed.

As your pager is the read end and is quitting, it's closing the read end of the pipe. Hence the program writing to the pipe, man in this case, is going get an error when it tries to write to the pipe.

So the error message is coming from man, not pg.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0