We already saw what a command substitution is:
zarrelli:~$ time=$(date +%H:%M) ; echo $time
10:06
The output of a command gets stored as a string into a variable, and it is then available to be used in any way we need. So, for instance, we could well do this:
zarrelli:~$ myfile="myfile.txt.tgz" ; content=$(tar -tzf $myfile) ; echo $content
myfile.txt
In this case, we used the command substitution to perform a test on a tar file whose name was provided by means of a variable. The output of the command substitution was then fed as an argument to echo, which showed us the outcome of the tar command. We could use an even more complex command inside the command substitution bit, but beware of some issues with escaping since what happens inside the parentheses is not always what we would expect.
Is this a valid way to make processes communicate with...