Left side of pipe is the subshell?

前端 未结 2 1409
灰色年华
灰色年华 2020-12-03 03:35

Edit:

My comment below regarding sed \'s@^@ @\' <(f1) is incorrect While $BASH_SUBSHELL indicates that we are in the same level as

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 04:22

    Here is a much concise example if someone cares :

    cd / && cd /tmp/ | pwd  ; pwd
    /
    /
    

    Or :

    cd / && cd /tmp/ | cd /var/  ; pwd
    /
    

    Yes this page says it all

    http://linux.die.net/man/1/bash# Each command in a pipeline is executed as a separate process (i.e., in a subshell).

提交回复
热议问题