sed - print range of lines excluding the starting and ending line of the range
sed -n '/sys/,/dmitritelinov/{//!p;}' /etc/passwd
The range of lines chosen is from 'sys' to 'dmitritelinov'. The action within the braces is applied only for this range of lines.
If no pattern is provided in pattern matching (//), the last matched pattern is considered.