LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-21-2003, 11:10 PM   #1
scabies
LQ Newbie
 
Registered: Dec 2003
Location: richmond, VA
Distribution: ubuntu
Posts: 25

Rep: Reputation: 15
sed? -- making substitutions


hello,

i want to add better titles to around 600 html files; i'd like to use sed because it seems the simplest way to do it. basically, i run the command

s/<title>/<title>Niles Register /gp

which prints out that substitutions are "successful", but the actual files aren't modified.

anyone know what i'm doing wrong? or should i use perl instead? this seems like a simple thing to get to work.

thanks in advance!
mike
 
Old 12-21-2003, 11:39 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
The problem you are experiencing is that sed is
a STREAM editor, not a file editor. All you need
to do is
sed <command mumble> -f file > file2
mv file2 file


Cheers,
Tink
 
  


Reply



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
can anyone help me on this one (sed) nukey Linux - Software 11 08-18-2005 09:34 AM
sed and escaping & in something like: echo $y | sed 's/&/_/g' prx Programming 7 02-03-2005 11:00 PM
summary and description substitutions when doing rpmbuild of Kernel dillybat Programming 0 01-14-2005 12:32 PM
Insert character into a line with sed? & variables in sed? jago25_98 Programming 5 03-11-2004 06:12 AM
Case sensitivity in SED substitutions jkoch Programming 1 02-21-2003 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:28 PM.

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
Open Source Consulting | Domain Registration