It's programming time!/Batch/Pipe
From Create Your Own Story
(Difference between revisions)
Underside (Talk | contribs)
(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…')
Next diff →
(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…')
Next diff →
Revision as of 02:25, 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:
- Make a batch file with the following lines:
dir | sort @pause
- Save your file without any formatting (Plain text).
- 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.