Date: Fri, 1 Sep 2023 11:37:32 +0200 From: Ede Wolf <listac@nebelschwaden.de> To: questions@freebsd.org Subject: Re: cut off last lines of a document Message-ID: <de480aeb-3f8c-4be2-8162-6d9f033f201a@nebelschwaden.de> In-Reply-To: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> References: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 01.09.23 um 10:43 schrieb Ede Wolf: > Hello, > > From a file/output with an unknown amount of lines, I would like to > filter out, or not display, the last 3 lines. Is there a way to archive > this? > > For those also using linux, there is a "head -n -3" for this. That > negative number option is not available on FreeBSD, but maybe there is > an alterative way of doing this? Preferably /bin/sh compatible. > > Thanks > > Ede > As a sidenote: If possible, I would like to avoid using "tail -r | tail -n +4 | tail -r" as well, as it again is specific to FreeBSD, so if there is a more universal solution, that would be preferred. Even though this of course is a FreeBSD mailing list.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?de480aeb-3f8c-4be2-8162-6d9f033f201a>