it seems RStudio to recognize the bash chunks and does not know how to comment those lines in this type of chunk.
I think this is something to report in RStudio IDE issue as a feature request. I did not find it yet (see https://github.com/rstudio/rstudio/issues)
I don't think there is something to be done in Rmarkdown for this IDE behavior
To comment those lines, you need to do it manually with #. You can get help with multiline selection shortcut (CTRL + ALT + down (or up)) ;This will duplicate the cursor many times and fill in all when you'll type #