You can specify an option hook that sets eval to FALSE if engine is bash. In the example Rmd file below, only the code in the R chunk will be evaluated:
---
title: "Untitled"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_hooks$set(eval = function(options) {
if (options$engine == "bash") {
options$eval <- FALSE
}
options
})
```
```{r}
print("run")
```
```{bash}
echo "run"
```
You can read more about option hooks in the chapter Option hooks from the R Markdown Cookbook.