X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Wilfried 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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" 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/