need help with script and sed

Frank Laszlo laszlof at
Fri Feb 18 17:40:07 GMT 2005

Jim Pazarena wrote:

> I would like to traverse my /users/home tree searching
> for all regular files and change any lines which read:
>   "/cgi-bin/Count.cgi ..." to:
>   " ..."
> I kinda think that a 'find' with an -exec of 'sed' would do
> it but I'm not sure, and even if it were, I'm not sure of
> the syntax.
> Could someone help me please?
> Thanks!
> Jim

for i in `find /users/home -type f`; do
    sed -i '' 
"s|/cgi-bin/Count.cgi||g" $i

This should do the trick.

    Frank Laszlo

More information about the freebsd-questions mailing list