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