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 /gemfeed/2022-01-01-bash-golf-part-2.md | |
| parent | f971e8595e3bb33157914f2d53a5dd587a326bb8 (diff) | |
Publishing new version
Diffstat (limited to 'gemfeed/2022-01-01-bash-golf-part-2.md')
| -rw-r--r-- | gemfeed/2022-01-01-bash-golf-part-2.md | 17 |
1 files changed, 15 insertions, 2 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 |
