help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Escaping in backquote string in double quoted strings --


From: Chet Ramey
Subject: Re: [Help-bash] Escaping in backquote string in double quoted strings -- query about bash intent
Date: Tue, 14 May 2019 14:20:23 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/7/19 8:52 AM, KHMan wrote:

> Here, for the case of a backquote string inside a double quoted string,
> there is no push_delimiter and pop_delimiter. If current_delimiter drives
> escape behaviour, this would account for the observed output for the test
> cases.

The backquotes are not quote characters.

> 
> I guess the comment means something but I only know how to write simple
> bash scripts so I have no idea what it really means:
>     Parse an old-style command substitution within
>     double quotes as a single word.

The idea is that you don't want a double quote inside the command
substitution to terminate the quoted string, so you consume it as a single
word. It's the difference between

$ cat bq
echo "`echo "<b>"`"
$ ./bash ./bq
<b>

and

$ ksh93 ./bq
./bq[1]: b: cannot open [No such file or directory]

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

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