Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Sep 2023 15:06:12 +0200
From:      Polytropon <freebsd@edvax.de>
To:        listac@nebelschwaden.de
Cc:        questions@freebsd.org
Subject:   Re: cut off last lines of a document
Message-ID:  <20230903150612.c88185f3.freebsd@edvax.de>
In-Reply-To: <ba983eee-b0bf-4bd9-a6ee-acf46f467229@nebelschwaden.de>
References:  <57be5495-97f8-4f22-9ae2-cd9712596e64@nebelschwaden.de> <de480aeb-3f8c-4be2-8162-6d9f033f201a@nebelschwaden.de> <v2srpri7wvagrqjuw4jdrucdmy7aifgmlwl32ibtv3zc3ves7m@zl4vf4yeom7f> <ba983eee-b0bf-4bd9-a6ee-acf46f467229@nebelschwaden.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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.
In such cases, your script might not be the most optimum one,
it might even be a bit inefficient, but in the end, it will
run everywhere. It will even run on systems where you are
not allowed to (or not able to) install things you might
need, such as GNU tools. Assuming that the most recent tools
of one Linux distribution are available on all other Linusi
as well as on different UNIXes, and intending to use the
most modern and fashionable technologies will not cover the
specific cases of "other UNIX" you might run into. But in
case you can fully control your target environment, there
is absolutely nothing wrong in using state-of-the-art
script languages if they are available to you (or can
easily be made available by simply installing them).

Yes, I am old. And stupid. Says the guy who writes stuff
in sh, grep, sed, awk, cut, paste and other old-fashioned
languages because it _needs_ to run everywhere... ;-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230903150612.c88185f3.freebsd>