Issues using array credentials to read contents of a file

Hi,

I am trying to read the contents of a file using array credentials in unix. The file I am trying to read is tab separated and contains the below contents.

# partnerid Direc Server Port Source_Dir Target_Dir Mask Remove Files Passwordless Compare Files CopyLatest

I am reading the lines using a while loop and setting values using below command.
set -A CREDENTIALS_ARRAY ${line}

The first time I run the script it sets all the 11 parameters correctly in the array and script executes fine.Basically I read the contents to transfer the file $Mask from source to destination. Have shown sample files below. Mask has been set to achan* When I execute the script the second time it sets Mask=achan_dwh.sas7bdat and Remove Files=achan_dwh.sas7bndx , hence shifting the values forward by 1 parameter thereby setting the value of Remove Files into Passwordless field. Actually remove file is set to "N" and passwordless to "Y" but in this case sets passwordless to "N" and goes into the other section of the code to validate the Identity key which is wrong.

-rwxr-x--- 1 transfer sassrvOP 24576 May 12 19:26 achan_dwh.sas7bdat
-rwxr-x--- 1 transfer sassrvOP 24576 May 12 19:26 achan_dwh.sas7bndx

I suspect the array credentails is not getting cleared in the second run. IS there a way I could reset the array to zero each run or do you suspect some other issue here? Have not put the code since it is really huge.

It would be great if you could help me on this. Thanks in advance.

I wonder if it's taking -rwxr-x--- to be a parameter. My ksh certainly does, and tells me it's a malformed one, but who knows what that might mean on some other implementation. Try putting a -- between -A whatever and ${line} to tell it that anything following is a parameter and not a flag.

set -A arrayname -- ${line}

Hi,

Tried that but doesnt work. Is there a limit on the parameters an array can read? The script worked fine with 9 parameters, now I have included another two and its causing issues.

Contents of the file I am trying to read. Last two columns have been added.
# partnerid Direc Server Port Source_Dir Target_Dir Mask Remove Files Passwordless Compare Files CopyLatest
xyz I abc nn /ddd/eee/fff aaa/TEST uchan* N Y Y N
xyz I abc nn /ddd/eee/fff aaa/TEST achan_dwh* N Y Y N

It reads the first line correctly by the second line is read incorrectly.

From the logs:
1st line:
+ set -A CREDENTIALS_ARRAY xyz I abc nn /ddd/eee/fff aaa/TEST uchan* N Y Y N

2nd line: This is an issue. Instead of reading achan_dwh* it reads the actual file mask from the destination.

set -A CREDENTIALS_ARRAY sassrvF xyz I abc nn /ddd/eee/fff aaa/TEST achan_dwh.sas7bdat achan_dwh.sas7bndx N Y N N

Maybe if you posted your actual code.