On Sun, Sep 20, 2009 at 5:01 PM, Raul Suarez <rarsa at yahoo.com> wrote: > The following command will do it > > sed -i -e 's/\(.*\)foobar/#\1foobar/' <filepattern> > > for example > > > sed -i -e 's/\(.*\)foobar/#\1foobar/' *.sh > > This will do an in-place replacement. Perfect. Thank you, Raul.