Dave Yost <Dave@Yost.com> writes:
> I have an ugly function I wrote for zsh that does this:
>
> Sat 14:17:25 ip2 yost /Users/yost
> 1 634 Z% echo-quoted xyz \$foo 'a b c ' '\n'
> xyz '$foo' 'a b c ' '\n'
> Sat 14:17:53 ip2 yost /Users/yost
> 0 635 Z%
>
> It would be nice if there were an easy way to do this in bash.
printf "%q" does that.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."