From: Johan Förberg on 11 May 2010 16:08 I was wondering if there exists a simple solution for printing text from the console. A program that emulates a line-printer on CUPS or a pseudo- driver which creates a line-printer device so that text files can be printed easily from the shell. I'm thinking something along the lines of: $ someprogram > /dev/emulpt or $ cat myfile | lprint where you select some printer as standard printer or provide a printer name in the command line. Is there already such a solution which I have missed or can you explain how a shell script (or otherwise) can be used to print from any other program in approximately this fashion, please? Johan Förberg
From: John Hasler on 11 May 2010 16:15 Johan Förberg writes: > I was wondering if there exists a simple solution for printing text > from the console. lpr -- John Hasler jhasler(a)newsguy.com Dancing Horse Hill Elmwood, WI USA
From: unruh on 11 May 2010 16:27 On 2010-05-11, Johan F?rberg <johan(a)forberg.se> wrote: > I was wondering if there exists a simple solution for printing text from > the console. A program that emulates a line-printer on CUPS or a pseudo- > driver which creates a line-printer device so that text files can be > printed easily from the shell. I'm thinking something along the lines of: > > $ someprogram > /dev/emulpt lpr filename.txt cups has a text filter which converts ascii text to printr output.
From: Johan Förberg on 11 May 2010 17:20 On Tue, 11 May 2010 20:27:41 +0000, unruh wrote: > lpr filename.txt > > cups has a text filter which converts ascii text to printr output. Works like a charm! Sorry to have bothered you with something that turned out to be so simple. Johan Förberg
From: J G Miller on 11 May 2010 17:27 On Tue, 11 May 2010 20:08:23 +0000, Johan Förberg wrote: > I was wondering if there exists a simple solution for printing text from > the console. If you want to fancify your text files into something nicer, have a look at a2ps. GNU a2ps - 'Anything to PostScript' converter and pretty-printer GNU a2ps converts files into PostScript for printing or viewing. It uses a nice default format, usually two pages on each physical page, borders surrounding pages, headers with useful information (page number, printing date, file name or supplied header), line numbering, symbol substitution as well as pretty printing for a wide range of programming languages. Obviously if you just want to print out a simple ASCII file with no formatting then lp -d printer_queue file_name will do the job.
|
Next
|
Last
Pages: 1 2 Prev: logical AND and OR with grep? Next: kudzu and renaming of network files |