shellQuote function

String shellQuote(
  1. String value
)

value as a single-quoted string literal for POSIX shells and Fish.

Implementation

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