I am trying to remove a list of specific words from all my files with a certain directory and replace them with nothing.
So:
This Awesome Content 720p BLAH FOO BANG OOO - 30.9.2013.mp4
Becomes:
This Awesome Content - 30.9.2013.mp4
Now the following works great for a single find and replace one word.
find path/to/folder/ -maxdepth 3 -name '*.*' -execdir bash -c 'mv -i "$1" "${1//foo/}"' bash {} \;
I have also tried just multiple finds but this seems like a very long way of doing it and i seem to run into issues this way.
Couple of issues i have:
- Want it to be case insensitive
- Need "${1//foo/}" to refer to a list
- Remove white spaces if greater than 1
Trying to run this as a bash script on a cronjob.
Unless there is a better to way to remove everything between "This Awesome Content" - "30.9.2013.mp4".
Much appreciated.