Technical Discussion
  >> Apple Issues


Register (or login) on our website and you will not see this ad.


  Print Thread
Moderator billford
(moderator) Thu 12-May-11 01:51:18
Print Post

Command line printing


[link to this post]
 
Way back in the dim and distant I could issue a command like

dir c:\documents > lpt1:

or print | dir c:\documents

from a DOS command prompt and get the output on a printer.

I'll admit I haven't tried it, but I doubt if either would work under Snow Leopard tongue

Is there an easy way to redirect (or pipe) terminal output (generally, not just from the ls command) to the default printer, or is it easier to carry on redirecting output to a file and printing it from TextEdit?

I've tried a few man lookups, like man print, but they didn't help and I don't really know what I'm looking for crazy

~~~~~~~~~~~~
Bill

bill@thinkbroadband.com _______________Planes and Cars and ..._______________BQM
The author of the above post is a thinkbroadband moderator but it does not constitute an official statement on behalf of thinkbroadband.
Standard User AEP
(knowledge is power) Thu 12-May-11 07:28:49
Print Post

Re: Command line printing


[re: billford] [link to this post]
 
The equivalent to the DOS print command is "lpr". Try piping the output of the command to that.
Standard User AlanH
(knowledge is power) Thu 12-May-11 09:48:54
Print Post

Re: Command line printing


[re: AEP] [link to this post]
 
man lpr gives details.

I just tried:

echo "Hello World" | lpr

and it printed as expected.

Alan
Demon since forever, HomeOffice MaxDSL since 2006 via Netgear DG834G router
Mac Pro 2.66GHz 4GBytes / MBP 13" - Snow Leopard plus Centos4 & XP Pro in Parallels

Edited by AlanH (Thu 12-May-11 09:51:20)


Register (or login) on our website and you will not see this ad.

Moderator billford
(moderator) Thu 12-May-11 10:06:03
Print Post

Re: Command line printing


[re: AlanH] [link to this post]
 
That's the kiddie, works a treat smile

Thanks both.

~~~~~~~~~~~~
Bill

bill@thinkbroadband.com _______________Planes and Cars and ..._______________BQM
The author of the above post is a thinkbroadband moderator but it does not constitute an official statement on behalf of thinkbroadband.
  Print Thread

Jump to