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


Groups > gnu.bash.bug > #15175

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

From Ilkka Virta <itvirta@iki.fi>
Newsgroups gnu.bash.bug
Subject Re: Combination of "eval set -- ..." and $() command substitution is slow
Date 2019-07-16 12:18 +0300
Message-ID <mailman.1492.1563268736.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>

Show all headers | View raw


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

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


Thread

Re: Combination of "eval set -- ..." and $() command substitution is slow Ilkka Virta <itvirta@iki.fi> - 2019-07-16 12:18 +0300

csiph-web