Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Search and replace with variable

$
0
0
Hello all,

I stumbled upon a command line for multiple search and replace within given destination
Code:

perl -pi -w -e 's/SEARCH_FOR/REPLACE_WITH/g;' *.html
I want to replace the following line where the date is the variable, from
Code:

<div class="meta">
<ul>
<li>05.05.2015

with date tags, like so
Code:

<div class="meta">
<ul>
<li><date>05.05.2015</date>

Is there at all a solution to this? Please forgive my ignorance - this is all very new to me.

Any help and guidance is much appreciated.

Viewing all articles
Browse latest Browse all 16232

Trending Articles