On Wed, Apr 30, 2008 at 06:02:38PM +0200, Penguin Lover Alan McKinnon squawked:
> On Wednesday 30 April 2008, Matthew R. Lee wrote:
> > I have a folder full of .html files and I need to go through and
> > replace in each and every one of them a couple of bits of info. I
> > know I can do this using the following from the command line:
> > sed 's/VV, ppp-ppp/81, 51-67/' file.html > newfile.html | mv
> > newfile.html file.html
> 
> Somehow somewhere you can accomplish what you want in one line with a  
> suitable combination of locate, find, grep, for, xargs, sed and awk

Right, as an addendum to my other solution, in the case where files
are spread across a directory tree, run the following in the base
directory of tree:

find ./ -name "*.html" -exec sed -i.bkup 's/VV, ppp-ppp/81, 51-67/' {} +

(yes, that's a '+' character at the end). You can, of course, tweak
the parameter to find to get finer control of exactly which files you
want modified; this is left as an exercise to the reader. 

W
-- 
Introducing: the
       Universal Conterexample Matrix
           [ 0 1 ]
           [ 0 0 ]
    if you ever suspect a statement is false for linear transformations,
    it will be false for the Universal Counterexample Matrix.
                      ~Prof. Edward Nelson. MAT 217. P-town
Sortir en Pantoufles: up 509 days, 14:49
-- 
[email protected] mailing list

Reply via email to