From nobody Fri Sep 1 10:28:22 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RcZ4T2pZYz4sLhp for ; Fri, 1 Sep 2023 10:28:25 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RcZ4T17D6z3d3J for ; Fri, 1 Sep 2023 10:28:25 +0000 (UTC) (envelope-from michaelsprivate@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-500a8b2b73eso3094763e87.0 for ; Fri, 01 Sep 2023 03:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693564103; x=1694168903; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=PrzWbGEmpZy0+ecW5k5gfNtKlU4J0U5U/ro+LEMhnKc=; b=m8/i5Q9hleBB6bPR4vAUpLLyv2F/TYWmhNF0d64JXLm56Mi55vYGfxGPecAnF/mtkA df6avZ76bikG1CuAHy/AZuuiG8UPI+0NJH1koSyIdPGi0CGnZ6b1VSRaSPUT6sVnxKpk 3+/UzDDpysmpt6dF+EbMJkSKonFqaUdCP5XKq9Vz3M75b6dsj8mG8StmgI01pnyKsAxR oZKL3o9dAMFl1aCxTl8t0/FvKxGiMUeBM12CBQDcXHs3enVGhbNgMblCE/M4y5ZX3+kN C76mhCniuBDMLHso94N8fBPFdo1IBnKLXRxU31psY7gF48tU3ThpZ6g7wfTP3parJGTw xVWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693564103; x=1694168903; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PrzWbGEmpZy0+ecW5k5gfNtKlU4J0U5U/ro+LEMhnKc=; b=RCF2b8qaT9bdTWj+4MdVcCU4oy9SppvNdyZgcqb/qpyFnNVuiai6gNc5m7XUBjHioJ f1Arvv0Yo1FJpPsXc/SQsIDuk67p+gq+HqJcWlzPZe2F4BZ4yAmzK8kMAbrUXqfF8jD4 Jb/ZUNs9f9lhQ5eBlXCGIHdJX1GPCPw491jGsmnWnsbuCRHPSuXAf5ndbWO49rpAS0nn EDv1FvKopjAgN8MaxERwucI1C4AqX+E3DTPjjIbLvndn8fhKE7MStz0CzvBVSWXrM7+u MBheNwAceRG7K8lh6RkZc56Q/DXal6++EgMFf4XHLF5ipXqCdHIrrUXDvMaLVKzh5lVX rR1g== X-Gm-Message-State: AOJu0YzydSPsxaU31H1CJhz4Br5fncVD/r4Zbi+epte+/20seBtlJ9JZ CNQF48BsHPttNwHP4lvW4B2W4KRwBatLeWX1ao8/LyCL0TFQQSQp X-Google-Smtp-Source: AGHT+IE9AYwrCEPDrS3AWgO5aBtzKUM408+Haa7NZVTRkbWWncmRClNb8dqZVGF+W3Fg7Z+lD89BF0gpA1vIjv9jQe4= X-Received: by 2002:a05:6512:754:b0:4fe:8f66:28a3 with SMTP id c20-20020a056512075400b004fe8f6628a3mr1074610lfs.0.1693564102555; Fri, 01 Sep 2023 03:28:22 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> In-Reply-To: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> From: Michael Schuster Date: Fri, 1 Sep 2023 12:28:22 +0200 Message-ID: Subject: Re: cut off last lines of a document To: listac@nebelschwaden.de Cc: User Questions Content-Type: multipart/alternative; boundary="000000000000bcbc1f0604499ec5" X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-Rspamd-Queue-Id: 4RcZ4T17D6z3d3J --000000000000bcbc1f0604499ec5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Sep 1, 2023 at 12:23=E2=80=AFPM Ede Wolf = wrote: > 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. > For a first go, I'd try a combination of "wc -l" and "head". (don't have a BSD box up at the moment to check other utils) HTH Michael > Thanks > > Ede > > --=20 Michael Schuster http://recursiveramblings.wordpress.com/ recursion, n: see 'recursion' --000000000000bcbc1f0604499ec5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Sep = 1, 2023 at 12:23=E2=80=AFPM Ede Wolf <listac@nebelschwaden.de> wrote:
Hello,

=C2=A0From a file/output with an unknown amount of lines, I would like to <= br> 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. Tha= t
negative number option is not available on FreeBSD, but maybe there is
an alterative way of doing this? Preferably /bin/sh compatible.

For a first go, I'd try a combin= ation of "wc -l" and "head".
(d= on't have a BSD=C2=A0box up at the moment to check other utils)

HTH
M= ichael


Thanks

Ede



--
recursion, n: see 'recursion'
--000000000000bcbc1f0604499ec5--