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


Groups > gnu.bash.bug > #15173 > unrolled thread

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

Started byRobert Elz <kre@munnari.OZ.AU>
First post2019-07-16 00:49 +0700
Last post2019-07-16 00:49 +0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Combination of "eval set -- ..." and $() command substitution is slow Robert Elz <kre@munnari.OZ.AU> - 2019-07-16 00:49 +0700

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

FromRobert Elz <kre@munnari.OZ.AU>
Date2019-07-16 00:49 +0700
SubjectRe: Combination of "eval set -- ..." and $() command substitution is slow
Message-ID<mailman.1449.1563213026.2688.bug-bash@gnu.org>
    Date:        Wed, 10 Jul 2019 17:21:00 +0000
    From:        astian <astian@e-nautia.com>
    Message-ID:  <bcd08f6c-1c13-0eb4-92b2-4e904b19a0ce@e-nautia.com>

I doubt it makes any difference to the timing, which I think
Chet has already answered, but it is worth pointing out that these
two commands ...

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

which (I believe)) are supposed to be the same thing, using the
different (ancient, and modern) forms of command substitution aren't
actually the same.   In the first $i is unquoted, in the second it is
quoted.   Here, since its value is just a number and IFS isn't being
fiddled, there is not likely to be any effect, but if you really
want to make those two the same, the first needs to be written as

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

Such are the joys of `` command substitutions (just avoid them).

kre

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web