I have a simple bash find and replace script ‘script.sh’ :
#!/bin/bash
find . -type f -name '.' -exec sed -i '' "s/$1/$2/" {} +
When I run my command ./script.sh foo bar, it works. Suppose now my two inputs strings $1 and $2 are sentences (with white spaces), how can I make the script to recognize each of them as whole strings ?
Add each sentence in quotes
"output
Edit:
Try this:
Ouput: