on Tue, Jan 09, 2001 at 08:30:59PM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Tue, Jan 09, 2001 at 11:29:31AM -0800, kmself@ix.netcom.com wrote:
> :on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
> PROTECTED]) wrote:
>
> :> find . -name *.txt -exec cp {} {}.tm
Jonathan D. Proulx wrote:
> also note that you must quote the wildcard '*.txt' to prevent shell
> expantion, but I feel the example stands bugs and all. Using xargs or
> for i in `find . -name '*.txt'` can result in stack overflows if there
> are alot of file (I don't know howmany, but it happened
On Tue, Jan 09, 2001 at 11:29:31AM -0800, kmself@ix.netcom.com wrote:
:on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
:> find . -name *.txt -exec cp {} {}.tmp \; -exec sed s/foo/boo/g {} \;
:>
:> or writing a small shell/perl/sed/awk/whatever script that
on Tue, Jan 09, 2001 at 08:20:18AM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Mon, Jan 08, 2001 at 11:52:26PM -0800, kmself@ix.netcom.com wrote:
>
> :> My vote for most elegant:
> :>
> :> find . -name *.txt -exec sed s/foo/boo/g {} \;
> :> {} refers to file found
sorry guys,
I actually didn't intend to bounce that message -- I had the focus on
the wrong X window while typing something unrelated, which obviously
turned out to be a valid mutt key sequence...
Anyway, thanks for your effort :-) (ok, ok, I'll shut up now...)
On Tue, Jan 09, 2001 at 02:33:34
csj schrieb:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Something along the lines of:
> >
> > replace "string one" "string foo" files-to-process
>
> sed is it! Thanks to John <[EMAIL PROTECTED]>, Michal
> <[EMAI
On Mon, Jan 08, 2001 at 11:52:26PM -0800, kmself@ix.netcom.com wrote:
:> My vote for most elegant:
:>
:> find . -name *.txt -exec sed s/foo/boo/g {} \;
:> {} refers to file found ^ ^must have \; to terminate
:> -exec
:
:This solution doe
on Mon, Jan 08, 2001 at 05:53:51PM -0500, Jonathan D. Proulx ([EMAIL
PROTECTED]) wrote:
> On Tue, Jan 09, 2001 at 12:54:34AM +0800, csj wrote:
>
> :for i in *.txt ; do mv $i $i.tmp ; sed s/foo/boo/g $i.tmp > $i ; done
> :
> :Can anybody comment on this little script? This appears to work, but
>
On Tue, Jan 09, 2001 at 12:54:34AM +0800, csj wrote:
:for i in *.txt ; do mv $i $i.tmp ; sed s/foo/boo/g $i.tmp > $i ; done
:
:Can anybody comment on this little script? This appears to work, but
:may be inefficient. And it's one step removed from what I want,
:recursive processing. That is, to
then do this:
for i in `find . -name *.txt` ; do blah ; done
and make sure you know what you're doing.
cheers, robt
csj wrote:
>
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Something along the lines of:
> >
> >
On Tue, 9 Jan 2001 00:54:34 +0800
csj <[EMAIL PROTECTED]> wrote:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> > Is there a tool to do a search-and-replace from the command line?
> > Something along the lines of:
> >
> > replace "string one" "string foo" files-to-process
>
> sed is it!
On Mon, Jan 08, 2001 at 12:56:45AM +0800, I wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
sed is it! Thanks to John <[EMAIL PROTECTED]>, Michal
<[EMAIL PROTECTED]>, und eechi von
csj wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
>
> I find it a bit of a hassle to keep 100+ files open just to change an
> ".html" to an ".htm." Note however that I intend to u
on Mon, Jan 08, 2001 at 01:42:08AM +0800, eechi von akusyumi ([EMAIL
PROTECTED]) wrote:
> suggestion:
>
> cat file | sed s/search/replace/gi >file2;cp file2 file1;
Note that this solution creates an additional process for each file
handled. The more elegant solution is:
$ sed -e '/search/s
On Sun, Jan 07, 2001 at 06:12:54PM +0100, Michal F. Hanula wrote:
> On Mon, Jan 08, 2001 at 12:56:45AM +0800, csj wrote:
> > Is there a tool to do a search-and-replace from the command
> > line? Something along the lines of:
> >
> > replace "string one" "string foo" files-to-process
> >
> > I fin
suggestion:
cat file | sed s/search/replace/gi >file2;cp file2 file1;
- Original Message -
From: "John Hasler" <[EMAIL PROTECTED]>
To:
Sent: Monday, January 08, 2001 1:29 AM
Subject: Re: Command line search and replace
> csj writes:
> > Is there a tool to
csj writes:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
> replace "string one" "string foo" files-to-process
Look at awk and sed.
--
John Hasler
[EMAIL PROTECTED]
Dancing Horse Hill
Elmwood, Wisconsin
On Mon, Jan 08, 2001 at 12:56:45AM +0800, csj wrote:
> Is there a tool to do a search-and-replace from the command line?
> Something along the lines of:
>
> replace "string one" "string foo" files-to-process
>
> I find it a bit of a hassle to keep 100+ files open just to change an
> ".html" to
18 matches
Mail list logo