Re: find - text

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Well, in your specific case you could replace it only in files that
are *.c or *.h, you can easily use an additional parameter to "find"
to accomplish that:

On Mon, Oct 6, 2008 at 12:34,  <tony.chamberlain@xxxxxxxxx> wrote:
>      find . -type f |
>      while read fil
>      do
>          sed -i 's/prog/name/g' $f    # change "prog" to "name"
>      done

Use instead:

find . -type f -name '*.[ch]' | ...

Maybe not what you're looking for, but from your examples that's how I
would approach it.

HTH,
Filipe
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux