no more grep!
This commit is contained in:
parent
b32491ea9c
commit
02c7e5cb1a
4
sx-open
4
sx-open
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user