Free Search and Replace for Multiple Files with Linux

A SIMPLE search and replace for multiple files sample:
http://www.gabeanderson.com/life/archives/000392.php

This is in Linux, done with bash (I think).


And I quote:
for fl in *.php; do
  mv $fl $fl.old
  sed \'s/FINDSTRING/REPLACESTRING/g\' $fl.old > $fl
  # rm -f $fl.old
 
# when uncommented, the above line erases original file.
done

Related Scribbles:
  • Programming
  • Linux Commands


  • ID: 279
    Author:
    leonard
    Date Updated:
    2003-12-23 00:22:55
    Date Created:
    2003-09-01 13:31:12

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> Free Search and Replace for Multiple Files with Linux
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.