need to retrieve values of parameter

Hi,

I am just new to this shell scripting wizard..i have a text file which contains content as below:

Parameter=10;

What should be the script which only fetches the value 10 not the Parameter.
The idea is to get the logic behind getting the value alone not its parameter,....

Use awk
Following will print value on screen:

awk -F'(=|;)' '{print $2}' inputFile

TO store in some variable:

val=$(awk -F'(=|;)' '{print $2}' inputFile)
echo $val

thanks anurag..!! it works..

---------- Post updated at 04:08 PM ---------- Previous update was at 03:21 PM ----------

It will be great if you help us in below :
We have a file with below contents
build number=1
Release number=23

& if we use the above mentioned command :
then..
it will gv both 1 & 23 as results.

What should be the way to get only 1 or only 23...?

while read line
do
    val=$(echo $line | awk -F'(=|;)' '{print $2}')
    echo $val
    <Your other script lines processing val>
    <Your other script lines processing val>
    .........................
done < inputFile

If lines in inputFile don't have semicolon at the end, then awk command may be written as: (Above also will work though)

awk -F= '{print $2}'

Hi Anurag,

I tried with this script but its still giving all the values at a go.
Please find the attachment comprising of the script,text file & result..
Let me know where i am wrong..!!!
Thx a lot for ur help...

What input to the script (if any)?
What processing in the script?
What expected output from the script?

your script will be:

param=$1
val=$(awk -F= -v param=$param '$0 ~ param{print $2}' inputFile)
echo $val

Now while running the script, you need to pass paramtername that you want to see, i.e.

script.ksh parameter1

OR

script.ksh parameter2