I would assume the cause is that the subshell does not have a previous command to wait on.
this post was submitted on 17 Jan 2025
2 points (75.0% liked)
Bash
876 readers
1 users here now
Talk about the Bash Shell and Bash scripting
founded 4 years ago
MODERATORS
Thanks, that was it! I've updated the post to include a final subshell example where we get the 127 return code we might have expected instead of the 255 from the second paragraph.
There's something different about cmd substitution subshells to regular ones that produces this behaviour (the 255), it's a quirk of BASH.