Re: File contents
"Craig" <firstname.lastname@example.org> writes:
> Could someone help with changing file contents in a specific
> directory with a number of files.
> I used greg to extract the criteria but need something to change it.
Greg should feel a bit abused... Poor guy.
Or did you mean the program?
greg - A tool testing framework.
In addition to the other solutions mentioned in this list you can use
rpl is a UN*X text replacement utility. It will replace strings with
new strings in multiple text files. It can work recursively over
directories and supports limiting the search to specific file
It's syntax is as simple as "rpl oldstring newstring *" but there are
some advanced options available.
Or you can use "replace" from mysql-server (OK, it is overkill to
install mysql just for getting this tool but maybe you use it anyway).
>From the man page:
replace - A utility program that is used by msql2mysql, but
that has more general applicability as well. replace changes
strings in place in files or on the standard input. Uses a
finite state machine to match longer strings first. Can be used
to swap strings.
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!
To UNSUBSCRIBE, email to email@example.com
with a subject of "unsubscribe". Trouble? Contact firstname.lastname@example.org