Hi
This is the same question you posted in:
Need help regarding replacing a part of string
Please folow the forum rules and do not multiple post....
however...following examples should help you on your way a little:
Code:
# mainstr="abacus sabre"
# echo $mainstr
abacus sabre
# echo $mainstr | sed 's/ab/cd/g'
cdacus scdre
# echo $mainstr
abacus sabre
# mainstr=`echo $mainstr | sed 's/ab/cd/g'`
# echo $mainstr
cdacus scdre