[Git-commits] [grml/grml-etc-core] fb139d: Replace ip-screen with hostname -I + sed

Darshaka Pathirana noreply at github.com
Fri Nov 22 13:32:00 CET 2024


  Branch: refs/heads/jkirk/screenrc_drop_ip-screen
  Home:   https://github.com/grml/grml-etc-core
  Commit: fb139db69f0f8f05b846f967a70da2de2e5eff17
      https://github.com/grml/grml-etc-core/commit/fb139db69f0f8f05b846f967a70da2de2e5eff17
  Author: Darshaka Pathirana <dpat at syn-net.org>
  Date:   2024-11-22 (Fri, 22 Nov 2024)

  Changed paths:
    M etc/grml/screenrc

  Log Message:
  -----------
  Replace ip-screen with hostname -I + sed

In grml/grml-scripts-core#3 we discussed and decided to rewrite
cpu-screen in Perl and drop ip-screen (and other scripts) to make
grml-scripts-core fit for ARM.

After some benchmarking of the Perl script implementations of ip-screen,
we finally decided to go for `hostname -I` + sed to get the same output
as ip-screen.

So we need to replace ip-screen with hostname -I + sed in our screenrc
as well. The command to get a drop-in replacement for ip-screen looks
like this:

    % hostname -I | sed -e 's/ [^ ]*:.*$//;s/ / | /g;s/ | $//'

Unfortunately we need "sh -c" to allow piping and also need to escape ^
with \^. Not sure why, the GNU/screen documentation does only mention %
for "String Escapes" (see: https://www.gnu.org/software/screen/manual/screen.html#String-Escapes)

I am not sure, if we should keep ip-screen as a wrapper script (which
might allow us, to use the output for other things).



To unsubscribe from these emails, change your notification settings at https://github.com/grml/grml-etc-core/settings/notifications


More information about the Git-commits mailing list