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.

3
  • Arrghhh.  I didn't see your edit until I had finished typing my answer.  Hope it helps anyway. Commented Jun 25, 2015 at 0:02
  • It does. Seems silly, but it hadn't occurred to me to use a heredoc- thanks! Commented Jun 25, 2015 at 0:16
  • 1
    It is also mentioned in bash man page: "[$]$ Expands to the process ID of the shell. In a () subshell, it expands to the process ID of the current shell, not the subshell." May be it also applies to subshells created for pipes Commented Jun 25, 2015 at 1:12