Jump to content

Copy stdin to stdout: Difference between revisions

→‎{{header|REXX}}: added the REXX computer programming language.
(→‎{{header|REXX}}: added the REXX computer programming language.)
Line 130:
=={{header|Python}}==
<pre>python -c 'import sys; sys.stdout.write(sys.stdin.read())'</pre>
 
=={{Header|REXX}}==
In the REXX language, &nbsp; the &nbsp; '''STDIN''' &nbsp; (default input
stream) &nbsp; is normally the console, &nbsp; and
the &nbsp; '''STDOUT''' &nbsp; (default output stream) &nbsp; is
normally the console. &nbsp; So for REXX, this task equates to copying data
from the console to itself.
<lang rexx>/*REXX pgm copies data from STDIN──►STDOUT (default input stream──►default output stream*/
 
do while chars()\==0 /*repeat loop until no more characters.*/
call charin , x /*read a char from the input stream. */
call charout , x /*write " " " " output " */
end /*while*/ /*stick a fork in it, we're all done. */</lang><br><br>
 
=={{Header|sed}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.