User login

replace

Create rewrite rules from new and old URLs using the power of Vim to munge text

As part of the move of Agaric content from Agaric.com to data.agaric.com, we needed to create a bunch (1,592 to be precise) redirects that look like this one:

RewriteRule ^nice-menus-drop-down-bug http://data.agaric.com/node/1048 [NC,R=301,L]

Stefan, in his wizardry, had already pulled a tab-separated-value file of the old path to the new URL, so that what we had was:

nice-menus-drop-down-bug http://data.agaric.com/node/1048

Vim search and replace between set lines

regular expression change on next lines vi
Doesn't even need a regexp. Just find and substitute.

Replace all occurrences of "link" with "visited" between lines 221 and 225:

:221,225s/link/visited/g

Syndicate content