Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15176

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

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Andreas Schwab <schwab@suse.de>
Newsgroups gnu.bash.bug
Subject Re: Combination of "eval set -- ..." and $() command substitution is slow
Date Tue, 16 Jul 2019 11:32:25 +0200
Lines 34
Approved bug-bash@gnu.org
Message-ID <mailman.1493.1563269552.2688.bug-bash@gnu.org> (permalink)
References <bcd08f6c-1c13-0eb4-92b2-4e904b19a0ce@e-nautia.com> <8091.1563212947@jinx.noi.kre.to> <08d234bc-5dca-38f5-cb38-02b0c7fee542@iki.fi> <mvmy30y8guu.fsf@suse.de>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain
X-Trace usenet.stanford.edu 1563269552 25063 209.51.188.17 (16 Jul 2019 09:32:32 GMT)
X-Complaints-To action@cs.stanford.edu
Cc Robert Elz <kre@munnari.OZ.AU>, bug-bash@gnu.org
To Ilkka Virta <itvirta@iki.fi>
Envelope-to bug-bash@gnu.org
X-Virus-Scanned by amavisd-new at test-mx.suse.de
X-Yow I want another RE-WRITE on my CAESAR SALAD!!
In-Reply-To <08d234bc-5dca-38f5-cb38-02b0c7fee542@iki.fi> (Ilkka Virta's message of "Tue, 16 Jul 2019 12:18:45 +0300")
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/26.2.90 (gnu/linux)
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic]
X-Received-From 195.135.220.15
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <mvmy30y8guu.fsf@suse.de>
X-Mailman-Original-References <bcd08f6c-1c13-0eb4-92b2-4e904b19a0ce@e-nautia.com> <8091.1563212947@jinx.noi.kre.to> <08d234bc-5dca-38f5-cb38-02b0c7fee542@iki.fi>
Xref csiph.com gnu.bash.bug:15176

Show key headers only | View raw


On Jul 16 2019, Ilkka Virta <itvirta@iki.fi> wrote:

> 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 *:

It is not portable, see the autoconf manual:

    ... is not portable, since not all shells properly understand
    `"`..."..."...`"', for example Solaris 10 ksh:

         $ foo="`echo " bar" | sed 's, ,,'`"
         ksh: : cannot execute
         ksh: bar | sed 's, ,,': cannot execute

    Posix does not specify behavior for this sequence.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Combination of "eval set -- ..." and $() command substitution is slow Andreas Schwab <schwab@suse.de> - 2019-07-16 11:32 +0200

csiph-web