From nobody Sun Sep 03 13:28:35 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 4Rdszj0tT7z4rTKg for ; Sun, 3 Sep 2023 13:28:49 +0000 (UTC) (envelope-from listac@nebelschwaden.de) Received: from mail.worldserver.net (mail.worldserver.net [217.13.200.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.worldserver.net", Issuer "EuropeanSSL Server CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rdszf2n8Gz3Z4p for ; Sun, 3 Sep 2023 13:28:46 +0000 (UTC) (envelope-from listac@nebelschwaden.de) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=nebelschwaden.de header.s=1687803001 header.b=jFkKCpJK; spf=pass (mx1.freebsd.org: domain of listac@nebelschwaden.de designates 217.13.200.36 as permitted sender) smtp.mailfrom=listac@nebelschwaden.de; dmarc=none Received: from postpony.nebelschwaden.de (v22018114346177759.hotsrv.de [194.55.14.20]) (Authenticated sender: sendmail@nebelschwaden.de) by mail.worldserver.net (Postfix) with ESMTPSA id D91541E1BCC for ; Sun, 3 Sep 2023 15:28:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nebelschwaden.de; s=1687803001; t=1693747718; bh=KyHHVyV6pHb+zRYSsobI6FV9D9JBG9v9/m69pkslL4o=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To:From; b=jFkKCpJKsL0jOYU8aJjTmt8q5QUtl6oi7geGk7ZpOX2Zr3Xe1llPmbP70UMjZ6Lc6 DnJod2FDt9TrFYHyUsh06OcK9JBxrmMknwwFPmwYtTEPc7OsrV9itXq2ejLnICJSYm CsqeysGhf3mib43OqKnRZdnenluKC2jiqfg+EAPn1eWDosVTX+82Pf6/ck/cmjGe/S WzttMDB8zsD8fDNVWen+OA+RcpsNJvx1yQ08E9TO0Q03hPv3xObyK02Lm6H9WnxYz4 pYEtAv2I/wRcM9lCaCG/ZNIxVJLEBPmNIAfJrknrh3qy2o0PC7j3l3UKjKMgAKpDyM y3SIYu9gtc5AA== Received: from [172.16.37.5] (kaperfahrt.nebelschwaden.de [172.16.37.5]) by postpony.nebelschwaden.de (Postfix) with ESMTP id E4D561125C2 for ; Sun, 3 Sep 2023 15:28:35 +0200 (CEST) Message-ID: <5d2d90d1-b842-4a84-846b-dd0c56cd47b4@nebelschwaden.de> Date: Sun, 3 Sep 2023 15:28:35 +0200 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 User-Agent: Mozilla Thunderbird Reply-To: listac@nebelschwaden.de Subject: Re: cut off last lines of a document To: questions@freebsd.org References: <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> <20230903150612.c88185f3.freebsd@edvax.de> Content-Language: en-US From: Ede Wolf In-Reply-To: <20230903150612.c88185f3.freebsd@edvax.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.57 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.99)[-0.986]; R_SPF_ALLOW(-0.20)[+ip4:217.13.200.0/24]; R_DKIM_ALLOW(-0.20)[nebelschwaden.de:s=1687803001]; RCVD_IN_DNSWL_LOW(-0.10)[217.13.200.36:from]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[nebelschwaden.de]; HAS_REPLYTO(0.00)[listac@nebelschwaden.de]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15657, ipnet:217.13.192.0/20, country:DE]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MLMMJ_DEST(0.00)[questions@freebsd.org]; DKIM_TRACE(0.00)[nebelschwaden.de:+]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4Rdszf2n8Gz3Z4p Am 03.09.23 um 15:06 schrieb Polytropon: > On Sun, 3 Sep 2023 10:05:46 +0200, Ede Wolf wrote: >> Am 02.09.23 um 05:37 schrieb lain.: >>> On 2023年09月01日 11:37, the silly Ede Wolf claimed to have said: >>>> 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. >>> >>> I should point out that FreeBSD coreutils are not GNU coreutils, so >>> there are going to be differences. >>> And there are 1000s of different versions of coreutils available, >>> because they're so easy to re-create, and each one of them work >>> differently. >>> >> >> I am aware of this, that is why I am so thankfull for the sed and awk >> solutions provided here. Those are a little bit more handy than a perl >> script :) >> >> Of course there are differences between those tools as well, but so far >> those seem to have a common playground - the awk as well as sed examples >> so far are working for gnu as well as [Free|Net]BSD. Not even required >> to add the --posix flag to gnu sed. > > If I may: > > Everything depends. > > If your goal is maximum portability, you absolutely need to > stay away from GNU extensions. So if your script needs to run > on various Linux and UNIX (!) systems, only using the most > common tools in their most simple versions is the way to go. Maye there is a misunderstanding on my side, but that is exactly what I've asked for and what kindly has been provided to me?