Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 12-22-2003, 12:10 AM   #1
LQ Newbie
Registered: Dec 2003
Location: richmond, VA
Distribution: ubuntu
Posts: 25

Rep: Reputation: 15
sed? -- making substitutions


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!
Old 12-22-2003, 12:39 AM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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



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

All times are GMT -5. The time now is 04:00 AM.

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