Difference between subshells and process substitution
22
votes
2
answers
6622
views
In bash, I want to assign my current working directory to a variable. Using a subshell, I can do this.
var=$(pwd)
echo $var
/home/user.name
If I use process substitution like so:
var=<(pwd)
echo $var
/dev/fd/63
I have understood that process substitution is primarily used when a program does not accept STDIN. It is unclear to me what a process substitution exactly does and why it assigns
/dev/fd/63
to var
.
Asked by PejoPhylo
(385 rep)
Sep 20, 2017, 08:12 AM
Last activity: Dec 20, 2024, 10:58 AM
Last activity: Dec 20, 2024, 10:58 AM