I am having challenges formatting some files. I want to delete everything between the [&lnP until the [&R] in the file1.trees and then create a new file called file1_edit.trees. But I am getting the error 'bad flag in substitute command: '/''
sed -i '' 's/[&lnP/,/[&R]/{//!d;}/g' file1.trees > file1_edit.trees Error --->> sed: 1: "s/[&lnP/,/[&R]/{//!d;}/g": bad flag in substitute command: '/'
sed 's/[&lnP\/,/[&R]/{\/!d;}/g's(substitute) within a line or tod(delete) a range of lines.