On 28 Feb, Stroller wrote:
> Hi there,
>
> If I want to automagically replace text in a file, I can use `sed`. I don't
> believe that `sed` can be invoked in such a way to change the file in place,
> therefore two commands are necessary:
>
>$ sed 's/Project Gutenberg/Wordsworth Classics/' f
On Sun, Feb 28, 2010 at 4:41 PM, Stroller
wrote:
>
> On 28 Feb 2010, at 19:06, Etaoin Shrdlu wrote:
>>
>> On Sunday 28 February 2010, Stroller wrote:
>>>
>>> ...
>>> $ sed 's/Project Gutenberg/Wordsworth Classics/' foo > bar
>>> $ mv bar foo
>>> $
>>
>> Have a look at sed's "-i" option.
>>
>>>
On Sunday 28 February 2010, Stroller wrote:
> > A starting point could be (after you make a backup of the whole tree)
> >
> > find /basedir -type f -exec sed -i 's/foo/bar/g' {} +
>
> Many thanks - that looks great!
>
> My only concern is that it is unreliable enough that you state the
> need to
On 28 Feb 2010, at 19:06, Etaoin Shrdlu wrote:
On Sunday 28 February 2010, Stroller wrote:
...
$ sed 's/Project Gutenberg/Wordsworth Classics/' foo > bar
$ mv bar foo
$
Have a look at sed's "-i" option.
Using `grep` I can search *recursively* through directories to find
the
text I'm
On Sunday 28 February 2010, Stroller wrote:
> If I want to automagically replace text in a file, I can use `sed`. I don't
> believe that `sed` can be invoked in such a way to change the file in
> place, therefore two commands are necessary:
>
>$ sed 's/Project Gutenberg/Wordsworth Classics/
Hi there,
If I want to automagically replace text in a file, I can use `sed`. I don't
believe that `sed` can be invoked in such a way to change the file in place,
therefore two commands are necessary:
$ sed 's/Project Gutenberg/Wordsworth Classics/' foo > bar
$ mv bar foo
$
Using `g
6 matches
Mail list logo