> -----Original Message-----
> From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On 
> Behalf Of Adam Thornton
> Sent: Wednesday, January 31, 2007 1:36 PM
> To: LINUX-390@VM.MARIST.EDU
> Subject: Re: OT: Linux and Railroad Diagrams
> 
> 
> On Jan 31, 2007, at 1:19 PM, David Boyes wrote:
> 
> >
> > /bin/csh
> > cd /usr/man           (note, *not* /usr/man/catman!)
> > foreach i (`ls -R *`) ( note backticks -- I'm sure there's a better
> > way,
> > but
> >                         what did you pay for this one? )
> > cat $i | troff -man | lpr -Pyourpsprinter
> > echo $i
> > end
> >
> 
> Ew, csh.
> 
> Man pages are also to be found under /usr/share/man on Linux
> systems.  And /usr/local/man and /usr/local/share/man.
> 
> In sh or bash, the loop would look like:
> 
> for i in $(ls -R) ; do
>    echo $i
>    cat $i | troff -man | lpr -Pyourpsprinter
> done
> 
> (And instead of backticks, $(command).  $() nests, which backticks
> don't.)
> 
> Adam

And just to be weird:

find . -type f | while read i;do echo "$i"; troff -man <"$i" | lpr
-Pyoupsprinter;done

Both of the previous posters get a "useless use of cat" award. 

I use "$i" instead of just plain $i on the off chance that some file may
have a shell metacharacter or blank in it.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

The information contained in this e-mail message may be privileged
and/or confidential.  It is for intended addressee(s) only.  If you are
not the intended recipient, you are hereby notified that any disclosure,
reproduction, distribution or other use of this communication is
strictly prohibited and could, in certain circumstances, be a criminal
offense.  If you have received this e-mail in error, please notify the
sender by reply and delete this message without copying or disclosing
it. 

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to