RFC Deprecate non-escapable single quote inside single quote block
feat: Ony can type quotes inside single quote block and has consistency in behavior for escape symbols.
This also enables '
to be representable inside ''
-strings.
BREAKING CHANGE: If users rely on \'
being not an escaped '
, their scripts break.
perf: impact
performance none
usability - consistency in learning language and in usage. no need to learn special escape case for single quotes
maintainability - This should be documented as difference to other shells.
code: input
let str1 = '\'' # valid
let str2 = '\' # invalid, because \' does escape
reason: Consistent behavior is important for usability, so cutting off unexpected cases is beneficial.
context: For arcane reasons the compatibility was not broken in other shells and you end up with quirks like
echo $'I\'m a linux admin.'
, if you want strings with '
included.
behavior of bash/dash/zsh/fish/oil
bash,dash,zsh and oil does not escape '
inside ''
-environment
fish does escape '
inside ''
-environment