Wraps a string in single quotes so that a POSIX shell treats it as a single literal argument.
Single quotes disable word splitting, glob expansion, and command substitution, so the shell
passes the value through exactly as given. The only character that cannot appear inside single
quotes is a single quote itself, which is closed, escaped, and reopened.
This is only valid for POSIX shells like bash. It is not correct for cmd.exe, which uses
entirely different quoting rules.
This protects a single round of shell parsing. If the command string will be parsed twice (bash
hands it to something that parses it again), quoting once is not enough; see
interpolationSafeWindowsPath in @augment-vir/node, whose backslash count assumes two rounds.
Wraps a string in single quotes so that a POSIX shell treats it as a single literal argument. Single quotes disable word splitting, glob expansion, and command substitution, so the shell passes the value through exactly as given. The only character that cannot appear inside single quotes is a single quote itself, which is closed, escaped, and reopened.
This is only valid for POSIX shells like
bash. It is not correct forcmd.exe, which uses entirely different quoting rules.This protects a single round of shell parsing. If the command string will be parsed twice (bash hands it to something that parses it again), quoting once is not enough; see
interpolationSafeWindowsPathin@augment-vir/node, whose backslash count assumes two rounds.