3 ms·
You mean it doesn't quote arguments automatically, it is safe so long as you always quote the command defer 'touch "a b"' (a usability pitfall I know, but
by remram 3y ago
You mean it doesn't quote arguments automatically, it is safe so long as you always quote the command
defer 'touch "a b"'
(a usability pitfall I know, but probably not fixable easily)
edit: maybe escaping could be added though, using sed?
DEFER="; ${DEFER}"
for arg in "$@"; do
DEFER="$(printf -- %s "${arg}" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/") ${DEFER}"
done