Skip to content
ᴀɴᴛᴏɴ ɴᴏᴠᴏᴊɪʟᴏᴠ edited this page Jun 23, 2024 · 4 revisions

Description

Checks all scriptlets for dissimilar redirect to /dev/null.

Problematic code

rm -f %{buildroot}%{_usr}/file >/dev/null 2>&1 || :
rm -f %{buildroot}%{_usr}/file 2>&1 >/dev/null
rm -f %{buildroot}%{_usr}/file >/dev/null  2>/dev/null
rm -f %{buildroot}%{_usr}/file 2>/dev/null >/dev/null || exit 0

Correct code

rm -f %{buildroot}%{_usr}/file &>/dev/null || :

Rationale

There are too many ways to redirect output to /dev/null. We recommend using the most optimal and shortest way of doing this.

Clone this wiki locally