Browse Source

Redirect the output of pipe to a file

rexim 4 years ago
parent
commit
903f3c6937
1 changed files with 5 additions and 6 deletions
  1. 5 6
      examples/pipe.c

+ 5 - 6
examples/pipe.c

@@ -3,14 +3,13 @@
 
 int main(void)
 {
-    INFO("------------------------------");
     CHAIN(IN(PATH("examples", "pipe.c")),
           CHAIN_CMD(PATH("tools", "rot13")),
-          CHAIN_CMD(PATH("tools", "hex"))
-          // OUT("output.txt")
-         );
-    INFO("------------------------------");
-    // CMD(PATH("tools", "cat"), "output.txt");
+          CHAIN_CMD(PATH("tools", "hex")),
+          OUT("output.txt"));
+    INFO("------------------------------------------------------------");
+    CMD(PATH("tools", "cat"), "output.txt");
+    INFO("------------------------------------------------------------");
 
 #ifdef _WIN32
     Sleep(1000);