how to change the content thru sed.....

Hi Everybody,

Another headache form myside,

i have a file name noname.txt having content as
CS007=NEW

and i have to write a scipt which will take the parameters as update,delete... with the 1st field of noname.txt (i.e. here CS007)
whose objective is to change the 2nd field of noname.txt as update or delete as per the input.

how can i achieve this for the following line.......
sed ' /CS007/ c\CS007=UPDATE' noname.txt using the variables...

like

sed ' /$1/ c\$1=$2' noname.txt

any other suggestions are also welcome....

sed " /$1/ c\$1=$2" noname.txt

should do...

An alternative in Perl:

perl -pi -e "s/(CS007=)NEW/\1UPDATE/" noname.txt

but probably this doesn't fit your requirement

Thanx a lot....

the following method is also working,

'/'"$1"'/ c\'"$1"="$2"