Thursday, 15 August 2013

Spaces in Associative Array Keys while looping through multiple arrays in Bash -


I am facing many problems, while many collaborative arrays are being paused.

I am running the code (stripped of the real information)

  declare arrays = ("arrayone" "arraytwo") - A array = (["a"] = 1 ["two"] = 2) For the array in $ {array [*]} for $ $ in the array (eval resonance $$) [*] = 2) declared - A array = = (["blank" More text with the text "] = value [" empty space with "] = {'!' $ Array [@] \} is seen entirely" $ " 

It works perfectly well until I have run into the key value that keeps the space in it No matter what I do, I can not get items with empty space for proper treatment.

I appreciate your thoughts to get this work done. If that's the case, So there is a better way of doing this, I would be happy to hear it, I do not feel like scratched and started. It is best that I am able to come up with so far.

< P> Thank you!

Bash 4.3 This allows you to create a reference specifically to the other, in your case, you will declare

  - A assoc_one = (["one"] = 1 ["Two "] = 2) Announce - An ashoka_tobu = ([" Text with spaces "] = Value [" More text with spaces "] = separate value) Announce the -n array # to" $ {! Assoc_ @} "for the array in the $ {array {@}}"; for the key in the "$ {array} [@]}"; get 'one' 'two' 'text with more text with spaces " < / Pre> 

and it has happened. '

The names were changed to protect the idioms I mean, I have changed the names of the arrays so that I "$ {! Assoc _ @}" I can do the array without any particular code.


No comments:

Post a Comment