4 ms·printf "%q" "$VAR" P.S. quotes matter, surprisingly or unsurprisingly because “bash”by ramses0 3y agoprintf "%q" "$VAR" P.S. quotes matter, surprisingly or unsurprisingly because “bash”remram 3y agoI suspect that this works only for bash and won't work in other shells.patrec 3y agoIt works in bash and zsh, which are pretty much the only bourne-like shells that matter.