From e4676049f25c5fa0cb645d1555934fda88029fd5 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 15 Jun 2022 08:54:26 +0100 Subject: sweating the small stuff --- gemfeed/2022-01-01-bash-golf-part-2.html | 66 ++++++++++++++++---------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'gemfeed/2022-01-01-bash-golf-part-2.html') diff --git a/gemfeed/2022-01-01-bash-golf-part-2.html b/gemfeed/2022-01-01-bash-golf-part-2.html index 2402525b..2666ee3c 100644 --- a/gemfeed/2022-01-01-bash-golf-part-2.html +++ b/gemfeed/2022-01-01-bash-golf-part-2.html @@ -19,7 +19,7 @@ / / . / / .' . | jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Art by Joan Stark, mod. by Paul Buetow - +

Published by Paul at 2022-01-01, last updated at 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.

Bash Golf Part 1
@@ -39,14 +39,14 @@ lrwx------. 1 paul paul 64 Nov 23 09:46 0 -> /dev/pts/9 lrwx------. 1 paul paul 64 Nov 23 09:46 1 -> /dev/pts/9 lrwx------. 1 paul paul 64 Nov 23 09:46 2 -> /dev/pts/9 lr-x------. 1 paul paul 64 Nov 23 09:46 3 -> /proc/162912/fd - +

The following examples demonstrate two different ways to accomplish the same thing. The difference is that the first command is directly printing out "Foo" to stdout and the second command is explicitly redirecting stdout to its own stdout file descriptor:

 ❯ echo Foo
 Foo
 ❯ echo Foo > /proc/self/fd/0
 Foo
-
+

Other useful redirections are: