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


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

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

Started byIlkka Virta <itvirta@iki.fi>
First post2019-07-16 12:18 +0300
Last post2019-07-16 12:18 +0300
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 Ilkka Virta <itvirta@iki.fi> - 2019-07-16 12:18 +0300

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

FromIlkka Virta <itvirta@iki.fi>
Date2019-07-16 12:18 +0300
SubjectRe: Combination of "eval set -- ..." and $() command substitution is slow
Message-ID<mailman.1492.1563268736.2688.bug-bash@gnu.org>
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

[toc] | [standalone]


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


csiph-web