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 / itvi...@iki.fi