bash - pipe creates a subshell
问题 So this read is executed after the pipeline, which means that the output of the echo gets read into str - but because it is after a pipe, the contents of str are now in a subshell that cannot be read by the parent shell. My questions is - what happens in to the contents of str ? Does the pipe create a subshell, and then once the content are read into str , does the parent process kill the child process and str is erased - or does the contents of str live on somewhere outside the shell. Like