problem with sed commands

In a file with the following lines :

11.32.11.84_db1prd.world
11.32.11.85_db2prd.world

for db in `cat $DbProjListtmp`

do

`echo $db | awk -F'_' '{ print $1 }' | sed 's/11.32.11.84_/server1.com/g' < $DbProjListtmp > $DbProjList`

`echo $db | awk -F'_' '{ print $2 }' | sed 's/11.32.11.85_/server2.com/g' < $DbProjListtmp > $DbProjList`

`echo $db | awk -F'.prd' '{ print $3 }' | sed 's/prd/prp/g' < $DbProjListtmp > $DbProjList`

`echo $db | awk -F'.world' '{ print $4 }' | sed 's/.world//g' < $DbProjListtmp > $DbProjList`

done

Only .world has been removed on DbProjList.

I don't see any error on the other lines.

Thanks

Regards
bibi92Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
What result do you get, and what result do you want?
bibi92Author Commented:
The source file contains :
11.32.11.84_db1prd.world
11.32.11.85_db2prd.world

The target file will be contain :
server1.com_db1prp
server2.com_db2prp

Thanks
ozoCommented:
awk -F'[bp]' '{print "server" $2 ".com_db" $2 "prp"}' < source > target
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

bibi92Author Commented:
Thanks, I have to parse in a file containing and it can be contain another lines :
In a file with the following lines :

 11.32.11.84_db1prd.world
 11.32.11.85_db2prd.world
ozoCommented:
sed -e 's/11\.32\.11\.84/server1.com/' -e 's/11\.32\.11\.85/server2.com/' -e 's/d\.world/p/' < source > target

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bibi92Author Commented:
perfect, it works thine thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.