Il 19/12/20 12:42, David Haller ha scritto:
In summary:
==== #!/bin/bash OSRF="/home/marco/.thunderbird/cy71896h.Marco/signatures/os-release.txt"
"$OSRF" ### clear file exec 1>>"$OSRF"
printf 'Marco Calistri\n' rpm -q --qf 'Build: openSUSE Tumbleweed %{version}\n' -f /etc/os-release printf 'Kernel: %s\n' "$(uname -r)"
/etc/cron.hourly/sig-os-release
====
For the "Build" line, you could also parse os-release:
awk -F'[="]' '/PRETTY/{pn=$3;}/VERSION_ID/{v=$3;} END { printf("Build: %s %s\n", pn, v); }' /etc/os-release
or eval /etc/os-release for the "Build" line (UNSAFE):
eval "$(</etc/os-release)" printf 'Build: %s %s\n' "$PRETTY_NAME" "$VERSION_ID"
None of this is in any way dependent on the env, so should run with or without X and XFCE even running.
HTH, -dnh Very good stuff ! Many thanks, as you could understand I'm not a shell or worst a programmer expert, so many times I get stuck trying to "invent" new coding/scripting" :-P
Regards, -- Marco Calistri Build: openSUSE Tumbleweed 20201216 Kernel:5.9.14-1-default Desktop: