Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 4056

Programming • sed clue needed ...

$
0
0
I have a folder of ~100 .html files, each has an identical list of links to the others in a column (with nested lists and css hides) down the left side in the browser. I need to insert a new item into this list, and I'm accepting the risk that the insertion point in one or two files might not be the same line nr. To avoid the hassle of having to escape sensitive characters, I made a file new.txt containing (more or less)

Code:

<li>Item<ul><li><a href="one.html">one</a></li><li><a href="two.html">two</a></li></ul></li>
But I can't get sed to read the contents of new.txt

Code:

sed -i.bak '187a/r new.txt' test.html
writes a backup file, and the text "/r new.txt" on a new line 188.

Code:

sed -i.bak '187a\r new.txt' test.html
writes a backup file, and the text "r new.txt" on a new line 188.
Obviously I'm missing something??

Statistics: Posted by debbiethekiwi — 2026-01-03 00:30



Viewing all articles
Browse latest Browse all 4056

Trending Articles