Process Substitution in BASH - Commands for Linux

preview_player
Показать описание
Process Substitution in BASH - Commands for Linux
Process substitution allows you to run a single command or many commands in a subshell. You can then choose to either read from or write to your subshell.
By using process substitution you can replace a lot of workflows that would normally require you to create temporary files and have multiple command lines. You can accomplish most of these types of flows using process substitution, and all on a single command line.

One thing to remember when using process substitution is that you need to treat each process substitution in the same way that you would treat a file. For example you cannot provide echo with a file path and expect it to print out the content of the file. If you use echo in this way it will just print out the path to the file descriptor that was used for you process substitution.

In this video we cover a few examples using process substitution the first example shows you how to produce a side by side listing of two different directories using pr, ls and process substitution. The second example uses diff to
show us the files that are in one directory and not in the other.

In the final example we use md5sum to hash text that is written to our process substitution and demonstrate how the commands within our process substitution perceive this data.

Рекомендации по теме
Комментарии
Автор

Thanks again your videos help me to learn so much in such a simple manner.

spaceiswater