From 714545a84a6708ce47e78a01ce8f659f7acbe7fd Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Sat, 14 Apr 2018 10:08:44 +0800 Subject: ShellCheck refactor --- fzf-url.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'fzf-url.sh') 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 -- cgit v1.2.3