bug-bash
[Top][All Lists]
Advanced

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

Re: Backslash mysteriously disappears in command expansion when unescapi


From: Chet Ramey
Subject: Re: Backslash mysteriously disappears in command expansion when unescaping would reference an existing file
Date: Wed, 22 May 2019 15:49:06 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/22/19 3:14 PM, Charles-Henri Gros wrote:

> That's what I find a bit surprising (but shells are complicated, so
> maybe this is right. All I know is that the code used to work). I didn't
> think glob expansions applied to command expansions.

Command substitution is one of the word expansions, as is parameter
(variable) expansion. Pathname expansion (globbing) is applied to the
results of the other expansions and word splitting. The order is detailed
here:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06

> 
> All I want here is word split (which is why I can't use quotes)

You could always try turning off pathname expansion temporarily with
`set -f'.

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



reply via email to

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