On 10/22/15 8:13 AM, Linda Walsh wrote:
>
>
> Oleg Popov wrote:
>> On Thu, Oct 22, 2015 at 03:01:06AM -0700, Linda Walsh wrote:
>>> [cut]
>>> I.e. test output was:
>>> Case 2 got/Expected:
>>> "222"
>>> "1\ 222\ .3\ .4"
>>> [cut]
>>
>> You didn't initialize the array. By the time you do "parts[1]
Oleg Popov wrote:
$(...) is a subshell. Variables cannot be passed back from a subshell,
no matter how and where they are declared.
---
Um... oh.. in testor, still calling that way. I
missed that.
This is even more annoying for passing back results
than I thought. Grrr.
On Thu, Oct 22, 2015 at 03:01:06AM -0700, Linda Walsh wrote:
> [cut]
> I.e. test output was:
> Case 2 got/Expected:
> "222"
> "1\ 222\ .3\ .4"
> [cut]
You didn't initialize the array. By the time you do "parts[1]=222" it's
still empty. And in your previous message you tried to initialize it in
a
On Thu, Oct 22, 2015 at 05:13:45AM -0700, Linda Walsh wrote:
> Oleg Popov wrote:
> > On Thu, Oct 22, 2015 at 03:01:06AM -0700, Linda Walsh wrote:
> >> [cut]
> >> I.e. test output was:
> >> Case 2 got/Expected:
> >> "222"
> >> "1\ 222\ .3\ .4"
> >> [cut]
> >
> > You didn't initialize the array. By
Oleg Popov wrote:
On Thu, Oct 22, 2015 at 03:01:06AM -0700, Linda Walsh wrote:
[cut]
I.e. test output was:
Case 2 got/Expected:
"222"
"1\ 222\ .3\ .4"
[cut]
You didn't initialize the array. By the time you do "parts[1]=222" it's
still empty. And in your previous message you tried to initial
Greg Wooledge wrote:
Also I think you are completely misrepresenting the dynamic variable
scope system that bash uses. Variables are not just global or local.
There's an entire stack of them. When you reference a
variable (let's say i) inside a function, bash searches up
through the call