I would like to kill this quiz question and have a repoman check instead: 8. Why are 'head -5' and 'tail -5' bad? What should be used instead? Please implement such. Probably there are other non posix compliant things we can check too.
It would be nice to have a section on "shell code portability" in the devmanual or developer handbook if there isn't already.
I have no idea if we want to implement this nowadays. Note that it's no longer in quiz. Related: we have fixheadtails.eclass.
Opened PR for that new check request for pkgcheck
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=bad313667aa111639f9c5801d6f10420968ac2b9 commit bad313667aa111639f9c5801d6f10420968ac2b9 Author: Arthur Zamarin <arthurzam@gentoo.org> AuthorDate: 2022-11-03 17:43:47 +0000 Commit: Arthur Zamarin <arthurzam@gentoo.org> CommitDate: 2022-11-08 18:59:00 +0000 NonPosixHeadTailUsage: new check New warning for non-POSIX compliant head or tail without -n. Closes: https://bugs.gentoo.org/558360 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> src/pkgcheck/checks/codingstyle.py | 46 ++++++++++++++++++++++ .../NonPosixHeadTailUsage/expected.json | 5 +++ .../NonPosixCheck/NonPosixHeadTailUsage/fix.patch | 26 ++++++++++++ .../NonPosixHeadTailUsage-0.ebuild | 10 +++++ .../NonPosixHeadTailUsage-1.ebuild | 11 ++++++ 5 files changed, 98 insertions(+)