tests/testthat/examples/knitr-examples/027-engine-bash.md

Run bash scripts

# should exist
Sys.which("bash")
##            bash 
## "/usr/bin/bash"
Sys.which("sh")
##            sh 
## "/usr/bin/sh"

Does bash work?

echo hello world
echo 'a b c' | sed 's/ /\|/g'
# number of lines
awk 'END{print NR;}' 027-engine-bash.Rmd
## hello world
## a|b|c
## 23

How about sh?

# run wc on all engine examples
wc 027-engine-bash.Rmd
##  23  53 347 027-engine-bash.Rmd


Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on Aug. 21, 2025, 5:27 p.m.