I want to use them just for grouping, but is it actually spawning a subshell? (How can I tell?)
It's not spawning a subshell. TheYes, the commands within the (...) just groups the commands and runs themare run in the existing shella subshell.
EDIT: ToTo test whether you're in a subshell you can compare the PID of your current shell with the PID of the interactive shell.
echo $BASHPID; (echo $BASHPID);
It turns out I was wrong. The commands within the (...) are run inExample output, demonstrating that parentheses spawn a subshell. and curly braces do not:
$ echo $BASHPID; (echo $BASHPID); { echo $BASHPID;}
50827
50843
50827
$