[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how does escaping in "`...`" work?
From: |
Bob Proulx |
Subject: |
Re: how does escaping in "`...`" work? |
Date: |
Mon, 7 Jun 2010 16:56:22 -0600 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Matthew Woehlke wrote:
> How should bash interpret escapes in constructs like "`...`"?
The quoting rules for backticks are complex enough that the entire
construct has long been replaced with a completely different one. I
strongly suggest that instead of struggling to get the backtick syntax
quoted satisfactorily that you use $(...) instead. The rules there
are much more reasonable.
> $ echo "`echo "you don't say"`"
> you don't say
echo "$(echo "you don't say")"
> Is this how it is supposed to work?
Patient: Doctor, it hurts when I do this.
Doctor: Then don't do that.
Switch to using $(...) and you will be much less troubled by these
types of problems.
Bob