bug-bash
[Top][All Lists]
Advanced

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

Re: Combination of "eval set -- ..." and $() command substitution is slo


From: Ilkka Virta
Subject: Re: Combination of "eval set -- ..." and $() command substitution is slow
Date: Tue, 16 Jul 2019 12:18:45 +0300
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:60.0) Gecko/20100101 Thunderbird/60.7.1

On 15.7. 20:49, Robert Elz wrote:

                        printf '%s\n' "`printf %s "$i"`"
                        printf '%s\n' "$(printf %s "$i")"

aren't actually the same.   In the first $i is unquoted, in the second it is
quoted.

Huh, really? It looks to me like the first one treats $i as quoted too:

 $ touch file.txt; i='123 *'
 $ printf '%s\n' "`printf :%s: "$i"`"
 :123 *:

But not here, of course:

 $ printf '%s\n' "`printf :%s: $i`"
 :123::file.txt:

I tried with Bash and some other shells, but couldn't find one where the result was different. Did I miss something?


--
Ilkka Virta / itvirta@iki.fi



reply via email to

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