From: Nicolas Boisselier Date: Wed, 14 Dec 2016 09:13:27 +0000 (+0000) Subject: url2nc bug X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=c120c9b9b85a7d8024208b8db84a5f3eb799b1e0;p=nb.git url2nc bug --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 26b792d5..b42bb8e4 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -645,7 +645,7 @@ is_prompt() { url2nc() { local in="cat"; [ -n "$*" ] && in="echo $*"; - eval $in | perl -ne ' BEGIN{%p=("ssh"=>22,"https"=>443,"http"=>80);}; /([\w\._-]+):(\d+)/ and print "$1 $2\n" and next; m,^\w+://, or $_="ssh://$_"; m,^(\w+)://(?:[^@]+@)?([\w\._-]+), and print "$2 ".($p{$1}||22)."\n" and next' + eval $in | perl -ne ' BEGIN{%p=("ssh"=>22,"https"=>443,"http"=>80);}; /([\w\._-]+):(\d+)\b/ and print "$1 $2\n" and next; m,^\w+://, or $_="ssh://$_"; m,^(\w+)://(?:[^@]+@)?([\w\._-]+), and print "$2 ".($p{$1}||22)."\n" and next' } ls_users() {