>[оверквотинг удален]
>>>> sed '/^Ы */d;'
>>> Работает, но где здесь отрицание?
>> Здесь нет отрицания, здесь говориться, что надо удалять
>> все строки которые начинаются на Ы.
> ' - это "строгая" кавычка.
> / - это начало или конец сегмента.
> ^ - эта хрень зовётся "кроме" - эта хрень зовётся циркумфлекс (circumflex) и её значение зависит от местоположения.
> * - эта - "для всех"
> d - команда "удалить"
> ; - конец команды.ваша интерпретация команды '/^Ы */d;' звучит так: "удалить все строки не содержащие Ы в начале сегмента"
а задача стояла вывести все строки не содержащие Ы, что вы и сделали с помощью команды "удалить все строки, которые начинаются на Ы"
согласно info sed
`^'
Matches the null string at beginning of the pattern space, i.e.
what appears after the circumflex must appear at the beginning of
the pattern space.
In most scripts, pattern space is initialized to the content of
each line (*note How `sed' works: Execution Cycle.). So, it is a
useful simplification to think of `^#include' as matching only
lines where `#include' is the first thing on line--if there are
spaces before, for example, the match fails. This simplification
is valid as long as the original content of pattern space is not
modified, for example with an `s' command.
`^' acts as a special character only at the beginning of the
regular expression or subexpression (that is, after `\(' or `\|').
Portable scripts should avoid `^' at the beginning of a
subexpression, though, as POSIX allows implementations that treat
`^' as an ordinary character in that context.
`[LIST]'
`[^LIST]'
Matches any single character in LIST: for example, `[aeiou]'
matches all vowels. A list may include sequences like
`CHAR1-CHAR2', which matches any character between (inclusive)
CHAR1 and CHAR2.
A leading `^' reverses the meaning of LIST, so that it matches any
single character _not_ in LIST. To include `]' in the list, make
it the first character (after the `^' if needed), to include `-'
in the list, make it the first or last; to include `^' put it
after the first character.
The characters `$', `*', `.', `[', and `\' are normally not
special within LIST. For example, `[\*]' matches either `\' or
`*', because the `\' is not special here. However, strings like
`[.ch.]', `[=a=]', and `[:space:]' are special within LIST and
represent collating symbols, equivalence classes, and character
classes, respectively, and `[' is therefore special within LIST
when it is followed by `.', `=', or `:'. Also, when not in
`POSIXLY_CORRECT' mode, special escapes like `\n' and `\t' are
recognized within LIST. *Note Escapes::.