no more grep!

This commit is contained in:
Jack L. Frost 2014-10-16 13:46:57 +04:00
parent b32491ea9c
commit 02c7e5cb1a
1 changed files with 2 additions and 2 deletions

View File

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