Re: shell scripting advise: Don't use backslashes inside backtick quotes



On Thu, Aug 04, 2005 at 01:19:50AM +0200, Roland Illig wrote:
> quote() {
> 	_sedexpr="s,','\\\\'',g"
>         _quotestr=`echo x"$1" | sed -e '1s,^x,,' -e "${_sedexpr}"`
>         echo "'${_quotestr}'"
> }
> 
> So if you ever use backticks, please don't use backslashes inside them.
> 
yes, it's a well-known ;) fact that backticks have weird semantics when
it comes to about any other nested quoting.
really old shells will explode on your current version, too, but we
really needn't to consider those.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.



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