Re: cut off last lines of a document
- Reply: Ede Wolf : "Re: cut off last lines of a document"
- In reply to: Ede Wolf : "Re: cut off last lines of a document"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 03 Sep 2023 13:06:12 UTC
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, ...