diff --git a/site/pages/scripts/redirecting.html b/site/pages/scripts/redirecting.html new file mode 100644 index 0000000..6991e74 --- /dev/null +++ b/site/pages/scripts/redirecting.html @@ -0,0 +1,31 @@ + + + + + + + + +

Redirecting Outputs

+

First of all, to redirect a certain output of the command-line we have to use the symbol ">".

+

Even in this case, we will use a file named "Hello", in which we want to move a certain output, like "Sun".

+
+

$ echo Sun > Hello

+

So if we copy the the file on our command-line, the output will be the following:

+

$ cat Hello
+ Sun

+
+
+

If we want to move a certain output to an existing file, we just have to use twice the ">" symbol.

+
+

$ echo Bright >> Hello

+

$ cat Hello
+ Sun
+ Bright

+
+
+

Redirecting Inputs

+

To redirect an input from a file for a command, you have to use symbol "<".
+ In fact, it's not useful, as the result that obtain is just the content of the file.

+

Redirecting inputs becomes useful when it comes to chaining, so let's see it.

+

Chaining