I\'m trying to find and replace a string in a folder of files.
Could someone possibly help me?
My script is as follows:
#!/bin/bash OLD=\"Thi
The output goes to screen (stdout) because of the following:
stdout
sed "s/$OLD/$NEW/g" "$f"
Try redirecting to a file (the following redirects to a new files and then renames it to overwrite the original file):
sed "s/$OLD/$NEW/g" "$f" > "$f.new" && mv "$f.new" "$f"