Commit e9e2268c authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm-search: rewrite without bashisms

parent 8eb9c9d9
...@@ -90,12 +90,19 @@ __epm_search_make_grep() ...@@ -90,12 +90,19 @@ __epm_search_make_grep()
local list= local list=
local listN= local listN=
for i in $@ ; do for i in $@ ; do
local NOR="${i/^/}" case "$i" in
[ "$NOR" = "$i" ] && list="$list $NOR" || listN="$listN $NOR" ^*)
# will clean from ^ later (and have the bug here with empty arg if run with one ^ only)
listN="$listN $i"
;;
*)
list="$list $i"
;;
esac
done done
#list=$(strip_spaces $list | sed -e "s/ /|/g") #list=$(strip_spaces $list | sed -e "s/ /|/g")
listN=$(strip_spaces $listN | sed -e "s/ /|/g") listN=$(strip_spaces $listN | sed -e "s/ /|/g" | sed -e "s/\^//g")
[ -n "$listN" ] && echo -n " | egrep -i -v -- \"$listN\"" [ -n "$listN" ] && echo -n " | egrep -i -v -- \"$listN\""
...@@ -108,7 +115,7 @@ __epm_search_make_grep() ...@@ -108,7 +115,7 @@ __epm_search_make_grep()
local COLO="" local COLO=""
# rule for colorife # rule for colorife
for i in $list ; do for i in $list $listN; do
[ -n "$COLO" ] && COLO="$COLO|" [ -n "$COLO" ] && COLO="$COLO|"
COLO="$COLO$i" COLO="$COLO$i"
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment