for eg. input :
// copyright
package com.base
import com.base
import com.base
...
i want to replace the pattern "// copyright\n\n^package.*" with another string
i'm trying to do using
sed -e 's/.,^package/$(anotherString)/g' $text
Using sedHere is a
Did you want to remove all of the original
Using awk
|
||||
|
// copyright
andpackage ...
? One or two ? Your example has one empty line in between but you're saying you want to replace// copyright\n\npackage.*
which means two empty lines in between... – don_crissti Apr 16 at 17:18