Koozali.org: home of the SME Server

Coreutils - can we have newer versions of tail & cut?

Offline smeghead

  • *
  • 557
  • +0/-0
Coreutils - can we have newer versions of tail & cut?
« on: August 13, 2022, 10:43:39 AM »
Hi all

I'm writing a script where I want to use the -z option of both tail & cut, which for SME10 is not currently an option.

These programs are part of coreutils, we currently have:  coreutils-8.22-24.el7_9.2.x86_64 (the last version for Centos 7.x I believe)

The version of coreutils that includes the newer version of tail & cut is 8.25 or newer but I can't find this version for Centos 7.x

Version 8.30 was used for Centos 8 to start as far as I can tell.

So, is it safe to upgrade & hence can I install a newer version from say centos 8 given it updates a LOT of other programs not just tail and cut?  My guess is no but it doesnt hurt to ask those that know more than I.

FYI I'm using it as part of a routine to cleanup files in a backup folder, it looks like:

find /path/to/backup/folder -maxdepth 1 -type f -printf '%Ts\t' -print0 \
| sort -rnz \
| tail -n +11 -z \
| cut -f2- -z \
| xargs -0 -r rm -f

The -z  (zero terminated option) makes this work robustly.

I'm happy to use other code but I admit the above routine seems clean, simple, and has a certain elegance to it for me.

Cheers
..................

Online ReetP

  • *
  • 3,722
  • +5/-0
Re: Coreutils - can we have newer versions of tail & cut?
« Reply #1 on: August 13, 2022, 11:16:52 AM »
SMEv10 is based on Cent 7. You can't just upgrade it to a new vesiom of the underlying OS (same as previous versions) as there are substantial changes that make it very difficult - thanks RedHat.

I think moving from yum to dnf is one. There will be others.

We are prepping stuff in the background to try & get a v11 Alpha based on Cent8/Rocky in the new year. We are few and there is masses to do.......

Of course if talented people like yourself pitch in then it'll get done faster.....

The only alternative would be if you can build a new rpm yourself  but I suspect being 'core' utilities they may be tied to say glibc which can't be upgraded.

Jean Phillipe may know a trick to help you - he'll probably be about later

To help work on SME v11 just PM me for a login on our RocketChat & come and talk to us. We don't bite!!

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Online ReetP

  • *
  • 3,722
  • +5/-0
Re: Coreutils - can we have newer versions of tail & cut?
« Reply #2 on: August 13, 2022, 11:18:34 AM »
Actually, I do think you have a Rocket login?

Do please talk to us.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation