Accept strings and replace a string by another string.

echo -e “Enter the String::\c”

read str

echo -e “Enter the String where you want to replace::\c”

read rep

echo -e “Enter the String for replace::\c”

read word

str=echo $str | sed s/$rep/$word/g

echo $str




Enter the String::We are mca student

Enter the String where you want to replace::are

Enter the String for replace::all

We all mca student




Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.