Skip to content

unquotePosixShWord

unquotePosixShWord(word): string

Defined in: command/unquote-posix-sh-word.ts:16

Read back the value of a POSIX shell word, undoing single quotes, double quotes and backslash escapes.

The inverse of escapePosixShCommandArg, and of any other spelling of the same word: a shell word concatenates quoted and unquoted segments freely, so 'it'\''s' and it\'s both carry it's.

Expansion is not performed. $HOME and `id` are returned verbatim, which is what the single-quoted form means and the only reading available without a shell to run.

string

The word to read.

string

The value it carries.