I'm reading the bash manual and came to a section that states:
"Command substitution, commands grouped with parentheses, and asynchronous commands are invoked in a subshell environment that is a duplicate of the shell environment"
My question is, is there a way I could actually see what was executed in the subshell. For example say I wrote the line below. What would I need to do to actually see what was executed in the subshell?
$ printf "first\nsecond\nthird" | grep -E "(first|second)"
How would I check what was actually executed in the subshell (i suspect it does a grep for "first" and then a second shell to grep for "second", but I'd just like to see what it's doing).