]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Remove an unneeded 'tail -n 1' from a pipeline
authorlidl <lidl@FreeBSD.org>
Mon, 11 Mar 2019 13:33:03 +0000 (13:33 +0000)
committerlidl <lidl@FreeBSD.org>
Mon, 11 Mar 2019 13:33:03 +0000 (13:33 +0000)
commit375a0e48ae755dc3f51d2f4db974b36f9c3ffce3
treed28c1adcd07268b3fbac36462adad1dee279759d
parentf666b9e53585dea02ac8381f9c9d5b1a3bb08f73
Remove an unneeded 'tail -n 1' from a pipeline

When piping to awk, it's almost always an anti-pattern to use 'grep'
first.

When not in a pipeline, sometimes it is faster to use tail, as awk
must process all the lines in the input stream, and won't 'seek'.
In a pipeline, both grep and awk must process all lines, so we might
as well skip the extra process creation for tail and just use awk
for all the processing.

Reviewed by: jilles
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19441
libexec/rc/rc.d/growfs