From 07c56086aa0c4e015c9044e333ae4001debcb28d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 30 Apr 2024 13:14:09 +0300 Subject: Update content for html --- gemfeed/2021-11-29-bash-golf-part-1.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'gemfeed/2021-11-29-bash-golf-part-1.html') diff --git a/gemfeed/2021-11-29-bash-golf-part-1.html b/gemfeed/2021-11-29-bash-golf-part-1.html index 111f7175..9fc99072 100644 --- a/gemfeed/2021-11-29-bash-golf-part-1.html +++ b/gemfeed/2021-11-29-bash-golf-part-1.html @@ -8,7 +8,7 @@ -

Bash Golf Part 1


+

Bash Golf Part 1



Published at 2021-11-29T14:06:14+00:00; Updated at 2022-01-05

@@ -29,7 +29,7 @@ jgs^^^^^^^`^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2022-01-01 Bash Golf Part 2
2023-12-10 Bash Golf Part 3

-

TCP/IP networking


+

TCP/IP networking



You probably know the Netcat tool, which is a swiss army knife for TCP/IP networking on the command line. But did you know that the Bash natively supports TCP/IP networking?

@@ -63,7 +63,7 @@ X-Frame-Options: SAMEORIGIN
You would assume that this also works with the ZSH, but it doesn't. This is one of the few things which don't work with the ZSH but in the Bash. There might be plugins you could use for ZSH to do something similar, though.

-

Process substitution


+

Process substitution



The idea here is, that you can read the output (stdout) of a command from a file descriptor:

@@ -143,7 +143,7 @@ foo bar baz
Just think a while and see whether you understand fully what is happening here.

-

Grouping


+

Grouping



Command grouping can be quite useful for combining the output of multiple commands:

@@ -210,7 +210,7 @@ $ Expands to the process ID of the shell. In a () subshell, it expands to 1028739
-

Expansions


+

Expansions



Let's start with simple examples:

@@ -267,7 +267,7 @@ one:A one:B one:C two:A two:B two:C Linux-one:A-FreeBSD Linux-one:B-FreeBSD Linux-one:C-FreeBSD Linux-two:A-FreeBSD Linux-two:B-FreeBSD Linux-two:C-FreeBSD Linux-three:A-FreeBSD Linux-three:B-FreeBSD Linux-three:C-FreeBSD
-

- aka stdin and stdout placeholder


+

- aka stdin and stdout placeholder



Some commands and Bash builtins use "-" as a placeholder for stdin and stdout:

@@ -318,7 +318,7 @@ $ file - /dev/stdin: Perl script text executable
-

Alternative argument passing


+

Alternative argument passing



This is a quite unusual way of passing arguments to a Bash script:

@@ -360,7 +360,7 @@ paul:secret
But the downside of it is that the variables will also be defined in your current shell environment and not just in the scripts sub-process.

-

: aka the null command


+

: aka the null command



First, let's use the "help" Bash built-in to see what it says about the null command:

@@ -447,7 +447,7 @@ bash: 1: command not found... 4
-

(No) floating point support


+

(No) floating point support



I have to give a plus-point to the ZSH here. As the ZSH supports floating point calculation, whereas the Bash doesn't:

-- cgit v1.2.3