Skip to content

Instantly share code, notes, and snippets.

@marushu
Created June 1, 2017 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marushu/9c724cd1ce913f257596a5a89ea64fda to your computer and use it in GitHub Desktop.
Save marushu/9c724cd1ce913f257596a5a89ea64fda to your computer and use it in GitHub Desktop.
Set the value of search-replace based on the value of Movefile.
#!/bin/sh
# "../Movefil" : Set the path to Movefile in each project. Rewrite it accordingly.
# This command needs to be executed in the directory where the WordPress core is located.
# --skip-columns=guid
# @see https://developer.wordpress.org/cli/commands/search-replace/
wp search-replace $(grep "vhost:" ../Movefile | sed -e s/vhost://g | tr -d '\"\ ' | sed -n 2p) $(grep "vhost:" ../Movefile | sed -e s/vhost://g | tr -d '\"\ ' | sed -n 1p) --skip-columns=guid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment