From 707cf032574e7d9030666fd1c796e535ba66e441 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 1 Apr 2017 23:00:36 +0100 Subject: [PATCH] etc/profile.d/functions --- etc/profile.d/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 173ad523..fb80ef44 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -197,7 +197,7 @@ shell_ssh() { ips() { shell_help "Usage: $FUNCNAME [INTERFACE]. Print ip adresses." "$@" && return 1 - ifconfig | perl -ne 'BEGIN{$e=shift @ARGV; $e=~s/\W+/|/g}; /^(\w+)\s+/ and $i=$1; /^\s*inet (?:addr:)?([\d\.]+)/ and ($_=$1) ne "127.0.0.1" and (!$e or $i=~/^($e)$/) and print "$_\n"' "$*" + ( ip addr show || ifconfig ) 2>/dev/null | awk '/^[\t ]*inet /{sub("^[^0-9]*","",$2); sub("/[0-9]+","",$2); if ($2 != "127.0.0.1"){print $2}}' } env_add_path() { -- 2.47.3