syntax:expansion:proc_subst

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
syntax:expansion:proc_subst [2014/08/21 11:32]
senseialpha [Examples]
syntax:expansion:proc_subst [2018/03/02 09:54] (current)
centos-hater [Avoiding subshells] Grammar fix
Line 38: Line 38:
 Consider the following: Consider the following:
 <code bash> <code bash>
-diff <(ls $first_directory) <(ls $second_directory)+diff <​(ls ​"$first_directory") <​(ls ​"$second_directory")
 </​code>​ </​code>​
 This will compare the contents of each directory. In this command, each //process// is //​substituted//​ for a //file//, and diff doesn'​t see <(bla), it sees two files, so the effective command is something like This will compare the contents of each directory. In this command, each //process// is //​substituted//​ for a //file//, and diff doesn'​t see <(bla), it sees two files, so the effective command is something like
Line 50: Line 50:
 </​WRAP>​ </​WRAP>​
  
-One of the most common uses for process substitutions ​are to avoid the final subshell that results from executing a pipeline. The following is a **wrong** piece of code to count all files in ''/​etc''​ is:+One of the most common uses for process substitutions ​is to avoid the final subshell that results from executing a pipeline. The following is a **wrong** piece of code to count all files in ''/​etc''​ is:
  
 <code bash> <code bash>
  • syntax/expansion/proc_subst.1408620729.txt
  • Last modified: 2014/08/21 11:32
  • by senseialpha