LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   sed? -- making substitutions (https://www.linuxquestions.org/questions/linux-software-2/sed-making-substitutions-127963/)

scabies 12-21-2003 11:10 PM

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

Tinkster 12-21-2003 11:39 PM

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


All times are GMT -5. The time now is 11:32 AM.