Select exact err messages from every facility, excluding crit, alert, and emerg.
Which selector is appropriate?
Putting = before a priority requests an exact match, so *.=err selects only err.
Detailed explanation
*.errIncorrect. *.err also includes more severe priorities.
Incorrect. *.err also includes more severe priorities.
*.!errIncorrect. *.!err excludes err.
Incorrect. *.!err excludes err.
*.=errCorrect. *.=err matches only err.
Correct. *.=err matches only err.
err.=*Incorrect. It reverses facility and priority syntax.
Incorrect. It reverses facility and priority syntax.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '*.=err' | awk -F. '{print $2}'Expected result
=errKey points
- = means exact
- No equals means threshold
- ! means exclusion
Notes
- Environment: POSIX awk / 模擬selectorのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.