You'll need to cd into the directory you're operating in before running the script. First Bash file so is a bit rough, have to run it from the upper most directory for it to search through the folders.
When using WSL it will give a permission error when replacing in place. From my search, seems to be a permission issue on Windows. The replacement seems to work regardless though, bit of an odd one.
- WSL (OpenSUSE Leap 15.3)