I have \"I love Suzi and Marry\" and I want to change \"Suzi\" to \"Sara\".
#!/bin/bash
firstString=\"I love Suzi and Marry\"
secondString=\"Sara\"
# do some
This can be done entirely with bash string manipulation:
first="I love Suzy and Mary"
second="Sara"
first=${first/Suzy/$second}
That will replace only the first occurrence; to replace them all, double the first slash:
first="Suzy, Suzy, Suzy"
second="Sara"
first=${first//Suzy/$second}
# first is now "Sara, Sara, Sara"