no more grep!

This commit is contained in:
Jack L. Frost 2014-10-16 13:46:57 +04:00
parent b32491ea9c
commit 02c7e5cb1a

View File

@ -11,7 +11,7 @@ handle_uri() {
local target="$1" local target="$1"
for h in "${!uri_handlers[@]}"; do for h in "${!uri_handlers[@]}"; do
grep -oE "${uri_handlers[${h}]}" &>/dev/null <<< "$target" && { [[ "$target" =~ ${uri_handlers[${h}]} ]] && {
${h} "$target" & ${h} "$target" &
return 0 return 0
} }
@ -26,7 +26,7 @@ handle_fs_target() {
target_mimetype=$(file -ib "$target") target_mimetype=$(file -ib "$target")
for m in "${!mime_handlers[@]}"; do for m in "${!mime_handlers[@]}"; do
grep -oE "${mime_handlers[${m}]}" &>/dev/null <<< "$target_mimetype" && { [[ "$target_mimetype" =~ ${mime_handlers[${m}]} ]] && {
${m} "$target" & ${m} "$target" &
return 0 return 0
} }