command substitution fails with PS1 and multiline in one case

2014-08-03 Thread EmanueL Czirai
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'

Bug or feature: Why does Bash's "printf" define global variables?

2014-08-03 Thread Tim Friske
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

Re: Bug or feature: Why does Bash's "printf" define global variables?

2014-08-03 Thread Andreas Schwab
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