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
i have code
sed -ne "/''\;/wdestination.php" source.php
thats output in screenshot
but want copy matched line number in begining of line line data in next screenshot
sed -ne "/'</,/>'\;/{=;p}" source.php | sed 'n;s/\n/ /;wdestination.php'
hope looking +
Comments
Post a Comment