aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Fröhlich <nicolai.froehlich@schuettflix.de>2021-06-01 21:04:06 +0200
committerNicolai Fröhlich <nicolai.froehlich@schuettflix.de>2021-06-01 21:04:06 +0200
commit2952852499c4ffc805e14e30e41badfedc7d4583 (patch)
treea60fc81271e900f53e2cb69b1b3a805a2d43be2b
parent010490459294b52c356d5eb2040e7c49a46652a1 (diff)
downloadfork-tmux-fzf-url-2952852499c4ffc805e14e30e41badfedc7d4583.tar.gz
fork-tmux-fzf-url-2952852499c4ffc805e14e30e41badfedc7d4583.tar.bz2
fork-tmux-fzf-url-2952852499c4ffc805e14e30e41badfedc7d4583.zip
fix: urls of the form "https://www.*" show up twice in fzf selection
-rwxr-xr-xfzf-url.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/fzf-url.sh b/fzf-url.sh
index 1631d09..f156e52 100755
--- a/fzf-url.sh
+++ b/fzf-url.sh
@@ -30,7 +30,7 @@ else
fi
mapfile -t urls < <(echo "$content" |grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')
-mapfile -t wwws < <(echo "$content" |grep -oE 'www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/')
+mapfile -t wwws < <(echo "$content" |grep -oE '(http?s://)?www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*' | grep -vE '^https?://' |sed 's/^\(.*\)$/http:\/\/\1/')
mapfile -t ips < <(echo "$content" |grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{1,5})?(/\S+)*' |sed 's/^\(.*\)$/http:\/\/\1/')
mapfile -t gits < <(echo "$content" |grep -oE '(ssh://)?git@\S*' | sed 's/:/\//g' | sed 's/^\(ssh\/\/\/\)\{0,1\}git@\(.*\)$/https:\/\/\2/')