Getting the value from a parameter file

Hi
I am nebie to Unix
I have a prameter file which has semicolon seperated values which has the field

STATUS_CODE;9000;1;1200;2000

The values are dynamic ie. it can be 1,2,3...any number
How do i get all the values of this parameter into a variable
Please if anyone can help me out on this...
Thanks in advance

Hi,

In Bash or sh shell, you can do something like below.

variable_name=`echo "STATUS_CODE;9000;1;1200;2000" | awk '{ FS = ";" } { print $1}'

To check the variable value just type: echo $variable_name

If you want to store the complete string in one variable then do it as:

variable_name=`echo "STATUS_CODE;9000;1;1200;2000" | sed 's/;/ /g'`

awk -F";" '{ print $1 ; print $2 ; print $3 ; print $4 ; print $5}' parameter_file

this will separate all the parameters for you.

Not sure how to get them all in one variable. If that variable be an array then it may make some sense but otherwise are these parameters in one variable any good...?.