aboutsummaryrefslogtreecommitdiffstats
path: root/fzf-url.sh
diff options
context:
space:
mode:
authorWenxuan <wenxuangm@gmail.com>2018-04-14 10:08:44 +0800
committerWenxuan <wenxuangm@gmail.com>2018-04-14 10:08:44 +0800
commit714545a84a6708ce47e78a01ce8f659f7acbe7fd (patch)
tree247f8e4459278dc5fef05862b4e84ae875bec3a6 /fzf-url.sh
parent4ffbe9f01139e8f7fd4885ab4e74da6c2b52996b (diff)
downloadfork-tmux-fzf-url-714545a84a6708ce47e78a01ce8f659f7acbe7fd.tar.gz
fork-tmux-fzf-url-714545a84a6708ce47e78a01ce8f659f7acbe7fd.tar.bz2
fork-tmux-fzf-url-714545a84a6708ce47e78a01ce8f659f7acbe7fd.zip
ShellCheck refactor
Diffstat (limited to 'fzf-url.sh')
-rwxr-xr-xfzf-url.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/fzf-url.sh b/fzf-url.sh
index 48dcc45..ae5a75d 100755
--- a/fzf-url.sh
+++ b/fzf-url.sh
@@ -16,8 +16,9 @@ elif hash open &>/dev/null; then
fi
content="$(tmux capture-pane -J -p)"
-urls=($(echo "$content" |grep -oE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]'))
-ips=($(echo "$content" |grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9].*)?' | sed 's/\(.*\)/http:\/\/\1/'))
+IFS=' \n'
+read -ra urls <<< "$(echo "$content" |grep -oE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')"
+read -ra ips <<< "$(echo "$content" |grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9].*)?' | sed 's/\(.*\)/http:\/\/\1/')"
merge() {
for item in "$@" ; do