Re: loop through records

2009-03-12 Thread Duane Schweitzer
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

Re: loop through records

2009-03-11 Thread Chris F.A. Johnson
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

Re: loop through records

2009-03-11 Thread Greg Wooledge
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

Re: loop through records

2009-03-11 Thread Tony Zanella
346   Field 2: 0323 > Field 1: 187431346   Field 2: 0324 > Field 1: 187431346   Field 2: 0325 > Field 1: 187431346   Field 2: 0326 > > Thanks > -- > View this message in context: > http://www.nabble.com/loop-through-records-tp22463462p22463462.html > Sent from the Gnu - Bash mailing list archive at Nabble.com. > > > >

loop through records

2009-03-11 Thread OnTheEdge
; do echo "Field 1: ${REC[0]} Field 2: ${REC[1]}" done I would like to see something like this: Field 1: 187431346 Field 2: 0323 Field 1: 187431346 Field 2: 0324 Field 1: 187431346 Field 2: 0325 Field 1: 187431346 Field 2: 0326 Thanks -- View this message in co