|
From: | Andreas Tille |
Subject: | [Gnumed-devel] Re: Help with grepping |
Date: | Mon, 14 Feb 2005 22:41:44 +0100 (CET) |
On Tue, 15 Feb 2005, Ian Haywood wrote:
Thanks in anticipation.Do you mean, replace a string in all files, or in filenames? Andreas has given an answer to the second
Yes.
The first would be: for i in `ls`; do sed --in-place "s/oldname/newname/" $i
^^^^^ You might add a 'g' here which leads to sed --in-place "s/oldname/newname/g" $i if it might happen that oldname occures twice or more in one row. Kind regards Andreas. -- http://fam-tille.de
[Prev in Thread] | Current Thread | [Next in Thread] |