Linda Walsh writes:
> I have a feeling this would be hard to fix, since how can printf
> tell the difference between
> printf -v foo ""
> and
> printf -v foo
> ??
The latter has $# -eq 2.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F
Thats one of the reasons I suggested the following syntax
printf -v test "%s" ""
It doesn't have this problem it also saves other problems as well.
of if you want to expand back slashes etc.
printf -v test "%b" ""
Gesendet: Montag, 17. Juni 2013 um 08:33 Uhr
Von: "Linda Walsh"
On Sat, Jun 15, 2013 at 12:36:22PM -0700, Linda Walsh wrote:
> John Kearney wrote:
> >There is also a backdoor approach that I don't really advise.
> >val="${ArrayName}[Index]"
> >echo "${!val}"
> -
> Don't advise? Any particular reason? or stylistic?
I'd shared this advice ("don't use
Like I said its a back door aproach, it circumvents the parser. which
doesn't allow this syntax
${${Name}[1]}
I didn't actually find this myself it was reproted on this list a long
time ago. I do remember Chet saying he wouldn't break it. But other
than that I can't remember the d