Bash Cookbook 2e

However in Bash, introducing a pipe means the individual commands are run in subshells. Consider this: ... The output of the 2nd echo command prints just a single space. Whaaaa? What happened to my variables? Because the read command is in a pipeline, it is run in a subshell. It correctly reads 2 words from its stdin and assigns to the variables.

Bash Cookbook 2e 1

bash - What does <<< mean? - Unix & Linux Stack Exchange

Bash Cookbook 2e 2

In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ./myprogram &; echo $! will return the PID of the process which backgrounded myprog...

bash - What are the special dollar sign shell variables ... - Stack ...

Bash Cookbook 2e 4
Here-strings in bash are implemented via temporary files, usually in the format /tmp/sh-thd., which are later unlinked, thus making them occupy some memory space temporarily but not show up in the list of /tmp directory entries, and effectively exist as anonymous files, which may still be referenced via file descriptor by the ...

For understanding bash code it is usually very helpful to set the -x option: set -x # within a script / function or when calling a script: bash -vx ./script.sh With loops this is a little less helpful. But you can always take the first part of the command and do this: echo for url in $(cat example.txt) That shows you what happens there (at least the result). This feature is called "command ...

Bash Cookbook 2e 6

bash - What does $ ( ... ) mean in the shell? - Unix & Linux Stack Exchange

Bash Cookbook 2e 7

Modern shells such as Bash and Zsh have inherited this construct from Ksh, but it is not part of the POSIX specification. If you're in an environment where you have to be strictly POSIX compliant, stay away from it; otherwise, it's basically down to personal preference.