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?
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?
0
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
0
ozoCommented:
awk -F'[bp]' '{print "server" $2 ".com_db" $2 "prp"}' < source > target
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

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
0
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
0

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
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.