bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: a way to echo the arguments with quoting


From: Andreas Schwab
Subject: Re: RFE: a way to echo the arguments with quoting
Date: Sun, 02 Mar 2014 10:12:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]