Search Results

Search: Posts Made By: Kingzy
4,460
Posted By RudiC
As much as I hate to say it: ever since version 4...
As much as I hate to say it: ever since version 4 (which the OP seems to run), bash HAS associative arrays:

man bash:
You need to declare / typeset them correctly, though ...

typeset -A...
4,460
Posted By bakunin
I hate to say it, but: this was to be expected....
I hate to say it, but: this was to be expected. What you tried was a so-called "associative array". This is an array where the index is not numbers but (arbitrary) strings. There some programming...
4,460
Posted By bakunin
Only after writing my last post here i realised...
Only after writing my last post here i realised that you could construct a sort-of two-dimensional array out of delimited strings. Consider the following:

typeset array[1]="1-1:1-2:1-3"
typeset...
4,460
Posted By RudiC
Try again with the shebang in the first line set...
Try again with the shebang in the first line set to #!/bin/bash or whatever the correct path be.
4,460
Posted By bakunin
The underlying problem is: arrays in bash (and...
The underlying problem is: arrays in bash (and ksh88 as well) are ONE-dimensional. Therefore, you can create a variable holding a one-dimensional array, but you can't put other array variables as...
4,460
Posted By Don Cragun
I don't know if you can do what you're trying to...
I don't know if you can do what you're trying to do with bash, but you can do it with a 1993 or later version of ksh by using a name reference variable. You can't do it quite the way you were trying...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 11:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy