About Me

My photo
Bangalore, Karnataka, India
I am not old enough to know everything

Wednesday, September 2, 2009

Shell Scripting - Help

Hi


Code:
-----
DB1=("SQLSERVER", "INGRES", "ORACLE");
for (( i = 0 ; i < ${#DB1[@]} ; i++ ))
do
echo ${DB1[$i]};
done

Result:
-------
SQLSERVER,
INGRES,
ORACLE


I do the following piece of code for listing the array values one by one and the result i get is as above. do any one know how to trim the "," which appears in the Result. I know it will work if we remove the "," while assigning values to a array variable like this DB1=("SQLSERVER" "INGRES" "ORACLE"); but i can't do it as i need "," in that place as i need to pass this value to another program with comma, Help me if you are the right one am asking about....

Thanks
M Harish Gautham

Thursday, August 27, 2009