Commit d4a93dc3 authored by Vitaly Lipatov's avatar Vitaly Lipatov

update tools_estrlist from estrlist package

parent 05ba1d9e
...@@ -121,15 +121,25 @@ reg_wordremove() ...@@ -121,15 +121,25 @@ reg_wordremove()
strip_spaces "$RES" strip_spaces "$RES"
} }
reg_rqremove()
{
local i
local RES=""
for i in $2 ; do
[ "$i" = "$1" ] || RES="$RES $i"
done
strip_spaces "$RES"
}
# Args: LIST1 LIST2 # Args: LIST1 LIST2
# do_exclude_list print LIST2 list exclude fields contains also in LIST1 # do_exclude_list print LIST2 list exclude fields contains also in LIST1
# Example: exclude "1 3" "1 2 3 4" -> "2 4" # Example: exclude "1 3" "1 2 3 4" -> "2 4"
exclude() exclude()
{ {
local i local i
local RES="" local RES="$2"
for i in $2 ; do for i in $1 ; do
echo "$1" | grep -q -w "$i" || RES="$RES $i" RES="$(reg_rqremove "$i" "$RES")"
done done
strip_spaces "$RES" strip_spaces "$RES"
} }
...@@ -140,7 +150,7 @@ reg_exclude() ...@@ -140,7 +150,7 @@ reg_exclude()
local i local i
local RES="$2" local RES="$2"
for i in $1 ; do for i in $1 ; do
RES=$(reg_remove "$i" "$RES") RES="$(reg_remove "$i" "$RES")"
done done
strip_spaces "$RES" strip_spaces "$RES"
} }
......
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