From: Nicolas Boisselier Date: Fri, 21 Aug 2015 01:33:39 +0000 (+0100) Subject: ips args X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=9c566a2b37c33a621de2dc73a5b6595a77ad25d6;p=nb.git ips args --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index e91ed5ba..9633d768 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -71,7 +71,8 @@ shell_slogin() { } ips() { - ifconfig | perl -ne '/^\s*inet (?:addr:)?([\d\.]+)/ and $1 ne "127.0.0.1" and print "$1\n"' + 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"' "$*" } env_add_path() { diff --git a/lib/python/nb.pyc b/lib/python/nb.pyc index 0b6d762a..6f3d4bd2 100644 Binary files a/lib/python/nb.pyc and b/lib/python/nb.pyc differ