There are cases where you want to batch replace Canvas URIs across multiple IIIF manifest files.
For example, the command to replace www.dl.ndl.go.jp with dl.ndl.go.jp in JSON files under the current directory is as follows. The -i '' option is specific to macOS syntax.
Note: This script directly modifies files. Before using it on important data, I recommend taking precautions such as creating backups. Additionally, please be careful about the types of files you apply this to, as performing text replacement on binary files (such as images or executables) may corrupt them.
I hope this serves as a useful reference.