delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/07/21/09:52:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Wilfried <wh_ng AT gmx DOT de>
Subject: Re: lpr works? FAQ in error?
Date: Mon, 21 Jul 2008 15:52:25 +0200
Lines: 33
Message-ID: <9a498418e4cd1ia8ll54i7eqiehdjmq0m5@4ax.com>
References: <380-2200855974950906 AT cantv DOT net> <loom DOT 20080717T220746-843 AT post DOT gmane DOT org> <g5ov52$9pm$1 AT ger DOT gmane DOT org>
Mime-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

"jrsyangl" <jrsy DOT angl AT verizon DOT net> wrote:

> As a follow-up and clarification to my previous post, what I would like 
> to be able to do is to pipe output to a printer, e.g.
>  ls -l | lpr
> This doesn't work for me as I explained previously. Using notepad /P 
> instead of lpr doesn't work either.

It surely won't. You cannot feed text into notepad via a pipe.
To print via notepad, you need to write the output of "ls -l" to a file
then print this file via notepad.
Next problem: I have set up cygwin to use unix style line endings as
default. Now if I 
ls -l > tmp_file
and open tmpfile in notepad, notepad doesn't recognize the line endings,
at least not on screen. It nevertheless prints out correctly on my
printer, maybe because the printer itself interprets the line endings
correctly. But it may be better to use another editor instead,
perhaps pfe or pspad.
I ended up using a script -- you may need to modify it for your needs.
Assume you save this script as "abc", then you can call
abc ls -l 
and the script will execute the command "ls -l" and print its output via
notepad.
--------------snip-------------
#!/bin/sh 
$1 $2 $3 $4 $5 > tmp_file
/cygdrive/c/windows/notepad.exe /p tmp_file
rm tmp_file
--------------snip-------------

--
Wilfried Hennings


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019