It's programming time!/Batch/Pipe

From Create Your Own Story

< It's programming time! | Batch(Difference between revisions)
(Created page with '==Pipe== <div style="background-color:rgb(245,245,245);"> The Pipe operator '''(<nowiki>|</nowiki>)''' takes the output of one command and directs it into the input of another co…')
m
 
(One intermediate revision not shown)
Line 1: Line 1:
==Pipe==
==Pipe==
<div style="background-color:rgb(245,245,245);">
<div style="background-color:rgb(245,245,245);">
-
The Pipe operator '''(<nowiki>|</nowiki>)''' takes the output of one command and directs it into the input of another command.
+
The Pipe operator '''<nowiki>|</nowiki>''' takes the output of one command and directs it into the input of another command.
</div>
</div>
<div style="padding:0px 20px;">
<div style="padding:0px 20px;">
Line 16: Line 16:
*[[It's_programming_time!/Batch/Sort|Tell me more about '''sort'''.]]
*[[It's_programming_time!/Batch/Sort|Tell me more about '''sort'''.]]
*[[It's_programming_time!/Batch/Dir|Tell me more about '''dir'''.]]
*[[It's_programming_time!/Batch/Dir|Tell me more about '''dir'''.]]
 +
 +
[[Category:It's programming time!|Batch]]
 +
[[Category:It's programming time!/Batch|| Pipe Operator]]

Current revision as of 02:32, 16 July 2016

Pipe

The Pipe operator | takes the output of one command and directs it into the input of another command.

The following commands sort a directory alphabetically, then pause:

  1. Make a batch file with the following lines:
dir | sort
@pause
  1. Save your file without any formatting (Plain text).
  2. Double click your .bat file to execute the commands.

Remember: Don't edit the batch file while it's running. You can get unexpected errors that way.

Personal tools