There is the file with below content (file.conf):
/etc/:
rc.conf
passwd
/usr/:
/usr/local/etc/:
I need select lines between "/etc/:" and first-matching lines with ":" at the end.
cat ./file.conf | sed -n '/\/etc\/:/,/\/.*:$/p'
prints all content but I need
/etc/:
rc.conf
passwd
/usr/:
With this command cat ./file.conf | sed -n '/\/etc\/:/,/\/.*:$/p; :q'
the same.