[kwlug-disc] comment matching lines in multiple files

Richard Weait richard at weait.com
Sun Sep 20 17:09:29 EDT 2009


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.




More information about the kwlug-disc mailing list