diff options
| author | Paul Buetow <paul@buetow.org> | 2022-01-05 21:58:28 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-01-05 21:58:28 +0000 |
| commit | e06559e0d31dd8e0e1d8bf3729ffab186b34b6ea (patch) | |
| tree | 98d21cf68d571b91ba122dfad70df53130c8f403 | |
| parent | f971e8595e3bb33157914f2d53a5dd587a326bb8 (diff) | |
Publishing new version
| -rw-r--r-- | gemfeed/2022-01-01-bash-golf-part-2.md | 17 | ||||
| -rw-r--r-- | gemfeed/index.md | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gemfeed/2022-01-01-bash-golf-part-2.md b/gemfeed/2022-01-01-bash-golf-part-2.md index 1c0e95cf..78927f6a 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.md +++ b/gemfeed/2022-01-01-bash-golf-part-2.md @@ -12,7 +12,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow ``` -> Published by Paul Buetow 2022-01-01 +> Published by Paul Buetow 2022-01-01, last updated 2022-01-05 This is the second blog post about my Bash Golf series. This series is random Bash tips, tricks and weirdnesses I came across. It's a collection of smaller articles I wrote in an older (in German language) blog, which I translated and refreshed with some new content. @@ -60,7 +60,20 @@ It is, however, not possible to redirect multiple times within the same command. Foo ``` -This is where you can use grouping (neither of these commands will print out anything to stdout): +> Update: A reader sent me an email and pointed out that the order of the redirections is important. + +As you can see, the following will not print out anything: + +``` +❯ echo Foo 2>/dev/null 1>&2 +❯ +``` + +A good description (also pointe out by the reader) can be found here: + +[Order of redirection](https://wiki.bash-hackers.org/howto/redirection_tutorial#order_of_redirection_ie_file_2_1_vs_2_1_file) + +Ok, back to the original blog post. You can also use grouping here (neither of these commands will print out anything to stdout): ``` ❯ { echo Foo 1>&2; } 2>/dev/null diff --git a/gemfeed/index.md b/gemfeed/index.md index 28cf46d0..d679d4bf 100644 --- a/gemfeed/index.md +++ b/gemfeed/index.md @@ -2,7 +2,7 @@ ## Having fun with computers! -[2022-01-01 (1077 words) - Bash Golf Part 2](./2022-01-01-bash-golf-part-2.md) +[2022-01-01 (1134 words) - Bash Golf Part 2](./2022-01-01-bash-golf-part-2.md) [2021-12-26 (2101 words) - How to stay sane as a DevOps person ](./2021-12-26-how-to-stay-sane-as-a-devops-person.md) [2021-11-29 (1281 words) - Bash Golf Part 1](./2021-11-29-bash-golf-part-1.md) [2021-10-22 (2276 words) - Defensive DevOps](./2021-10-22-defensive-devops.md) |
