]> git.nbdom.net Git - nb.git/commitdiff
url2nc bug
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 14 Dec 2016 09:13:27 +0000 (09:13 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 14 Dec 2016 09:13:27 +0000 (09:13 +0000)
etc/profile.d/functions

index 26b792d5d497d4495a7983417663636bbee0f2ce..b42bb8e423e9fa65997cb6f310a790f513950011 100644 (file)
@@ -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() {