Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/locale'
Hi,
my assumption was that Bash's "printf" builtin implicitly defines a local
variable when used inside a function like so:
function foobar { printf -v foo bar; }
foobar
declare -p foo
# Prints "bar" from the global "foo" variable.
But instead I have to declare the "foo" variable
Tim Friske writes:
> my assumption was that Bash's "printf" builtin implicitly defines a local
> variable when used inside a function like so:
Why? A simple assignment doesn't either, and that's what printf does in
the end.
Andreas.
--
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprin