1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2026-04-18 12:14:05 +00:00
Files
prezto/modules/helper/functions/escape-eval

14 lines
238 B
Plaintext

#
# Escapes a string for safe use in ${(e)...} parameter expansion.
#
# Authors:
# Trey Keown <trey@crystalpeaksecurity.com>
#
# function escape-eval {
setopt LOCAL_OPTIONS EXTENDED_GLOB
print -r -- "${1//(#m)[\\\$\`]/\\$MATCH}"
# }