Category: command line

Command line goodness

Two good ones from today:
cygwin/perl: change all references to portfolio.html to portfolio_d.html.
perl -i -p -e ’s/portfolio\.html/portfolio_d.html/g’ *.html
More perl command line goodness here.
vim: on every line that has an element with an id attribute, take the value of that attribute and use it as the argument for a php command.
g/id="\([^"]\+\)"/ s/id="\([^"]\+\)"/value="<?php $io->p(’\1′); ?>" id="\1"/
More on […]