This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: lpr works? FAQ in error?

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:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]