2

Using a bash script, I'm having difficulty trying place one file into another based on a certain location.

||bob
||mary
||david

destination:

||urty
! comment
||gdfgrw
||fdfdf

So basically drop all of the contents of one file into (below the ! comment) header:

So the destination should look like this:

||urty
! comment
||bob
||mary
||david
||gdfgrw
||fdfdf
don_crissti
  • 82,805
  • What if there are multiple lines like ! comment ? Do you want to insert only after the 1st one or after all of them ? – don_crissti Mar 09 '18 at 22:29

1 Answers1

0
sed '/! comment/ r insertfile' destinationfile
||urty
! comment
||bob
||mary
||david
||gdfgrw
||fdfdf
steeldriver
  • 81,074