bug-bash
[Top][All Lists]
Advanced

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

Re: Backslashed space in variable/argument expansion does not prevent sp


From: Chet Ramey
Subject: Re: Backslashed space in variable/argument expansion does not prevent splitting.
Date: Fri, 17 Jun 2016 11:18:27 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 6/17/16 6:21 AM, Dean Wakerley wrote:

> Bash Version: 4.3
> Patch Level: 42
> Release Status: release
> 
> Description:
>  The expansion of a variable containing spaces splits on all spaces
> including escaped/backslashed space.

This analysis isn't correct, and the description above describes the
correct behavior.  A backslash in the expansion of a variable does not
have any special meaning to word splitting.  Backslashes are special to
the shell parser; if you want to have them interpreted, you need to run
the text through the parser.  This is usually accomplished using `eval'.

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



reply via email to

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