# extract between 2 patterns excluding patternssed '/PATTERNSTART/,/PATTERNEND/!d;//d' file.name