postheadericon Accept strings and replace a string by another string

clear
echo "Enter string : \c"
read str

echo "\n\nWhat you want to search from [ $str ] : \c"
read sStr

echo "\n\nEnter string to replace : \c"
read rStr

str=`echo $str | sed s/$sStr/$rStr/`

echo "\n\nstring replaced successfully \n New string is : $str "

0 comments:

Follow by Email

Total Pageviews

© BipinRupadiya.com. Powered by Blogger.