Thanks Chris, this was very helpful. I come from an oracle background and
I'm trying to transfer some of that into bash...
Duane
On Wed, Mar 11, 2009 at 3:44 PM, Chris F.A. Johnson wrote:
> On Wed, 11 Mar 2009, OnTheEdge wrote:
>
>
>> All, I'm trying to figure out how to loop through an array of
On Wed, 11 Mar 2009, OnTheEdge wrote:
All, I'm trying to figure out how to loop through an array of records (if
possible) and reference fields in that record, but I've only been able to
reference the entire array (array[0]) or when assigned with parens, there is
no concept of a row...
#!/bin/b
On Wed, Mar 11, 2009 at 01:11:51PM -0700, OnTheEdge wrote:
> array1="187431346 0323 mirrored 11866
> 187431346 0324 mirrored 11866
> 187431346 0325 mirrored 11866
> 187431346 0326 mirrored 11866"
That's not an array. It's just a big string.
array1=("187431346 0323 mirrored 11866"
"187431
awk may be a help here. Using it, you can refer to fields, like so:
$ cat f1
187431346 0323 mirrored 11866
187431346 0324 mirrored 11866
187431346 0325 mirrored 11866
187431346 0326 mirrored 11866
$ awk '{print $1;print$2}' f1
187431346
0323
187431346
0324
187431346
0325
187431346
0326
On Wed