escapePosixShCommandArg
escapePosixShCommandArg(
expr):string
Defined in: command/escape-posix-sh-command-arg.ts:21
Escape a string to be safely used as a shell argument in POSIX-compliant shells
It adds single quotes around a string and quotes/escapes any existing single quotes.
Example:
const unsafe = "It's a test";const safe = escapeShellArgPosix(unsafe);console.log(safe); // 'It'\''s a test'Parameters
Section titled “Parameters”string
The string to escape
Returns
Section titled “Returns”string
The escaped string