Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 6
    () does spawn subshell..perhaps you meant {}.... Commented Dec 3, 2015 at 18:36
  • @heemayl, that's the other part of my question—is there some way I can see or demonstrate on my screen the fact of a subshell being spawned? (That could really be a separate question but would be good to know here.) Commented Dec 3, 2015 at 18:43
  • 1
    @heemayl You're right! I had done echo $$ && ( echo $$ ) to compare the PID's and they were the same but just before I submitted the comment telling you you were wrong I tried one other thing. echo $BASHPID && ( echo $BASHPID ) gives different PID's Commented Dec 3, 2015 at 18:44
  • 1
    @heemayl echo $BASHPID && { echo $BASHPID; } give the same PID as you suggested would be the case. Thanks for the education Commented Dec 3, 2015 at 18:44
  • 1
    @Ruslan, David King: I've edited the answer to emphasize the accurate information which I found so helpful, and to remove the inaccurate points. Commented Sep 10, 2016 at 2:12