associative array assignment from the output of a function

2010-10-22 Thread Axel
Hello I try to assign an array from the output of a function. As this works for indexed arrays, it does not for associative arrays. I m using "GNU bash, version 4.1.7(1)-release (x86_64-redhat-linux-gnu)" on a Fedora 13 system. An easy example is better than an explanation: # Woks well index

Re: associative array assignment from the output of a function

2010-10-22 Thread Axel
Le 22/10/2010 14:42, Greg Wooledge a écrit : Unreliable at best. How do you handle elements that have whitespace in them, for example? You have to know your data set, choose a delimiter that can't be in that set, and then write code to parse the output stream into elements. At this moment, I

Re: associative array assignment from the output of a function

2010-10-22 Thread Axel
After your answer, I checked and I think the error message is not related to the variable name collision : [a...@axel-asus plugins]$ unset foo [a...@axel-asus plugins]$ func() > { > echo "[a]=5 [b]=10" > } [a...@axel-asus plugins]$ declare -A foo=( $(func) ) -bash: foo: [

Re: associative array assignment from the output of a function

2010-10-22 Thread Axel
Le 22/10/2010 16:21, Greg Wooledge a écrit : On Fri, Oct 22, 2010 at 02:59:37PM +0200, Axel wrote: Anyway, since this syntax works for assigning indexed arrays (even if it's a "hack"), should it works for associative array assignment ? Maintainers will decide I assume. But i

weird insert of backslashes in strings

2019-01-08 Thread axel
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -fstack-protector -Wno-parentheses -Wno-format-security uname output: Linux bongo 2.6.32-042stab134.8 #1 SMP Fri Dec 7 17:16:09 MSK 2018 i686 i686 i386 GNU/Linux Machin

bash --login in Cygwin environment does not use %HOME% when doing tilde expansion.

2005-02-16 Thread Axel B. Bregnsbo
e. Repeat-By: Set HOME in the ControlPanel>System>Advanced>EnvironmentVariables>User variables for abb Invoke bash by calling bash.bat containing: @echo off c: chdir C:\bin\cygwin\bin bash --login -i Axel B. Bregnsbo ASIC Designer, M.Sc.EE +45 44855990 [EMA