bug-bash
[Top][All Lists]
Advanced

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

Re: Command substitution


From: Lawrence Velázquez
Subject: Re: Command substitution
Date: Wed, 3 Jun 2020 03:57:38 -0400

> On Jun 3, 2020, at 3:18 AM, Martin Schulte <gnu@schrader-schulte.de>
> wrote:
> 
>> Unfortunely, I don't retrieve this behaviour in man page.
> 
> Me neither, maybe the manual should read
> 
> If the substitution appears within double quotes *or as the right-hand
> side of an variable assignment*, word splitting and filename expansion
> are not performed on the results.
> 
> at end of 3.5.4.

The 5.0.17(1) man page does mention this, under "PARAMETERS" (section
3.4 "Shell Parameters" in the manual):

    A variable may be assigned to by a statement of the form

           name=[value]

    If value is not given, the variable is assigned the null string.
    All values undergo tilde expansion, parameter and variable
    expansion, command substitution, arithmetic expansion, and quote
    removal (see EXPANSION below). If the variable has its integer
    attribute set, then value is evaluated as an arithmetic expression
    even if the $((...)) expansion is not used (see Arithmetic
    Expansion below). Word splitting is not performed, with the
    exception of "$@" as explained below under Special Parameters.
    Pathname expansion is not performed.

There are a couple of other places where word splitting and pathname
expansion are not performed:

https://mywiki.wooledge.org/Quotes#When_Should_You_Quote.3F

vq



reply via email to

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