bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: Some incorrect behaviour for BASH arrays


From: Victor Pasko
Subject: Fwd: Some incorrect behaviour for BASH arrays
Date: Fri, 1 Sep 2023 14:44:49 +0700

Just forward my response to all who was involved in discussion of my request

---------- Forwarded message ---------
From: Victor Pasko <victor.pasko@gmail.com>
Date: Fri, Sep 1, 2023 at 2:23 PM
Subject: Re: Some incorrect behaviour for BASH arrays
To: Kerin Millar <kfm@plushkava.net>


Thanks for the detailed explanations of *declare *.

As to the idea behind of my request:
1) I need local variable RESULT as empty string (not array)
2) this RESULT should collect symbols taken from other strings using
${STRING:i:1} for one symbol or ${STRING:i:k} for k-symbols
So, the main question is: how to save such sub-strings in RESULT at needed
j-place?
With another words - I need RESULT as C-char-array to use it something like
this

RESULT[j]="${STRING:i:1}"

In good examples of my bug.bash file there was used kind of accumulation
data in RESULT

RESULT="$RESULT${STRING:i:1}"

What about saving data in the direct place of the RESULT-string?
After your explanations, bash-arrays are not for such actions (my words -
do not work) :(
And a way to accumulate data in RESULT is the only possible in BASH.
What is your opinion or more suggestions?
Thanks

-- PSK


reply via email to

[Prev in Thread] Current Thread [Next in Thread]