This is the mail archive of the
mailing list for the Cygwin project.
Re: lpr works? FAQ in error?
- From: "Rodrigo Medina" <rodmedina at cantv dot net>
- To: cygwin at cygwin dot com
- Date: Fri, 18 Jul 2008 04:37:51 -0430
- Subject: Re: lpr works? FAQ in error?
- Reply-to: rodmedina at cantv dot net
Lou Umscheid 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. Is there a simple way to do this?
The problem with lpr is that it sends the file as it is to the printer, and
modern printers require some kind of translation of the file to their own
special language. You can send a text file to the printer using the
windows program NOTEPAD /P
For runnig notepad from a cygwin terminal you can use the command
cygstart. For example
cygstar notepad file.txt
opens file.txt in notepad.
cygstart notepad /P file.txt
sends file.txt to the printer.
The are 2 additional problems. Notepad prints Windows text files, with
the CRLF line endings. If your file is a unix text file with LF endings you
first to pass the file through the unix2dos filter that is part of the
The other problem is that Notepad does not know about cygwin pipes,
but you can make a bash script that passes the pipe input through the
unix2dos filter, writes the result in a temporal file, prints the file with
NOTEPAD /P and deletes the temporal file.
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html