shellQuote function

String shellQuote(
  1. String value
)

Quotes value as a single POSIX shell word: wrapped in single quotes with embedded quotes escaped the standard '\'' way. An empty value becomes ''.

Implementation

String shellQuote(String value) => "'${value.replaceAll("'", r"'\''")}'";