Anonymous user
Copy stdin to stdout: Difference between revisions
→{{header|REXX}}: added the REXX computer programming language.
(→{{Header|Prolog}}: Add Python) |
(→{{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, the '''STDIN''' (default input
stream) is normally the console, and
the '''STDOUT''' (default output stream) is
normally the console. 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}}==
|