Skip to content

Instantly share code, notes, and snippets.

@eripa
Created February 15, 2017 10:09
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 eripa/62fd48c9c68523f9bd325b3e48d225e9 to your computer and use it in GitHub Desktop.
Save eripa/62fd48c9c68523f9bd325b3e48d225e9 to your computer and use it in GitHub Desktop.
drop mysql table from dump
START_LINE=$(($(grep -n "Table structure for table \`wp_options\`" dump_tmp.sql | cut -d':' -f 1) -1))
END_LINE=$(($(grep -n "ALTER TABLE \`wp_options\` ENABLE KEYS" dump_tmp.sql | cut -d':' -f 1) +1))
sed "${START_LINE},${END_LINE}d" dump_tmp.sql > dump_tmp-no_options.sql
mv dump_tmp-no_options.sql dump_tmp.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment