LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2009, 03:19 PM   #1
djslothario
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Rep: Reputation: 0
Recursive find and replace for in files


Hi all,

I'm looking to find and replace the <title> of about 600 html documents on a website, going recursively through subdirectories. I tried doing this:

find="<title>"
replace="<title>Huntington's Disease Information - HOPES - "
find . -name '*.htm*' -print0 | xargs -0 sed -i "s/$find/$replace/"

This worked fine when I ran it in a test directory, however, when I ran it on the actual site it gave me this:

"xargs: sed: terminated by signal 11"

I suppose this means that it was basically overloaded. Thankfully, all my files are intact, though (and even if they weren't, they're backed up). How do I so something that won't crash?

Danny
 
Old 03-24-2009, 05:05 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi,

Welcome to LQ!
Quote:
"xargs: sed: terminated by signal 11"
From "man 7 signal"
Quote:
SIGSEGV 11 Core Invalid memory reference
The command as such was fine ... there's either a problem with your
hardware (RAM), or you have some conflicting versions of system libs
that sed is linked against installed.


Quote:
Thankfully, all my files are intact, though (and even if they weren't, they're backed up).
You *could* just sed -i.bak to preserve a back-up copy in place.



Cheers,
Tink

Last edited by Tinkster; 03-24-2009 at 05:08 PM.
 
Old 03-24-2009, 06:44 PM   #3
djslothario
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Original Poster
Rep: Reputation: 0
No, I'm doing this on Stanford web servers, which are professionally managed. I don't think they'd have a problem like that. Do you think it might be that they try to limit your CPU use?
 
Old 03-24-2009, 09:07 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
That's not what that signal means ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script: purge files more than N days old. Need Non Recursive Find explore.s AIX 3 12-04-2008 08:24 AM
Simple find&replace across 100 files saphil Linux - Newbie 2 01-03-2008 01:21 PM
Recursive Find tekmann33 Linux - Newbie 6 05-24-2007 01:28 PM
recursive find dhaus111 Linux - Newbie 10 01-11-2007 01:59 AM
find and replace in files from command line dexter_modem Linux - General 4 06-10-2003 12:27 PM


All times are GMT -5. The time now is 10:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration