Hello world/Line printer: Difference between revisions
m
removed quotation mark from batch; various other minor clean-up
(J) |
m (removed quotation mark from batch; various other minor clean-up) |
||
Line 5:
{{works with|QBasic}}
{{works with|ZX Spectrum Basic}}
<lang qbasic>LPRINT "Hello World!"</lang>
=={{header|Batch File}}==
<lang dos>ECHO Hello world!
=={{header|J}}==
Line 31 ⟶ 33:
=={{header|Tcl}}==
===[[Unix]]===
<lang tcl>exec lp << "Hello World!"</lang>
<lang tcl>set f [open |lp w]
puts $f "Hello World!"
close $f</lang>
===[[Windows]]===
<lang tcl>set f [open prn w]
puts $f "Hello World!"
Line 49 ⟶ 53:
{{works with|POSIX}}
Alternately, there are the character devices <tt>/dev/lp0</tt>, <tt>/dev/lp1</tt>, <tt>/dev/lpN</tt> and so on which correspond to line printers (if there are any attached to the system). Data written to these devices is sent to attached printers.
<lang bash>echo 'Hello World' > /dev/lp0</lang>
|