AWK or SED to add string at specific position

Greetings.
I don't have experience programing scripts. I need to insert a string in a specific position of another string on another file (last.cfg), for example:

File last.cfg before using script:
login_interval=1800
lcs.machinename=client04

File last.cfg after using script:
login_interval=1800
lcs.machinename=newclient04

I read about awk and sed comands, by I'm not sure what use and how. :confused:
Please, I'll thank so much if someone may help me or tell me if this problem has been solve on another post.

Vanesuke

awk -F"=" '{if($2 ~ /^client/){print $1"=new"$2}
else{print $1"="$2}' infile

try

sed 's/client04/newclient04/' last.cfg

to see what will happen (outpuit to screen)
if your sed version accepts the '-i' for "in place" then

sed -i 's/client04/newclient04/' last.cfg

to modify the file
if you use variables, then use double quotes like

sed "s/${TO_SEARCH}/${TO_INSERT}${TO_SEARCH}/" last.cfg

I used effectly:

sed "s/${TO_SEARCH}/${TO_INSERT}${TO_SEARCH}/" last.cfg

but changes have no effect in last.cfg, I have tried using -i command, but I obtanin "invalid option --i" message.
How can I save those changes on the file?
Thanks by your help.

If your sed don't support -i, then use perl -i

perl -i.bak -pe 's/client04/newclient04/' last.cfg