shell - extract matched line with line number between two pattern -


this question has answer here:

is possible copy line line number destinationphp file pattern match using sed, awk or grep? take example,
copy lines line number between '<(single quot less than) , '>;(single quot greater comma) source.php file destination.php

this source.php enter image description here

i have code
sed -ne "/''\;/wdestination.php" source.php
thats output in screenshot
enter image description here

but want copy matched line number in begining of line line data in next screenshot
enter image description here

sed -ne "/'</,/>'\;/{=;p}" source.php | sed 'n;s/\n/ /;wdestination.php'  

hope looking +


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -