mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-01-12 02:30:15 +02:00
functions.sh: add list_contains function for checking whether a list contains a specific element
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12025 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
097b27145d
commit
54988ba6a2
@ -24,6 +24,15 @@ append() {
|
|||||||
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
|
eval "export ${NO_EXPORT:+-n} -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_contains() {
|
||||||
|
local var="$1"
|
||||||
|
local str="$2"
|
||||||
|
local val
|
||||||
|
|
||||||
|
eval "val=\" \${$var} \""
|
||||||
|
[ "${val%% $str *}" != "$val" ]
|
||||||
|
}
|
||||||
|
|
||||||
list_remove() {
|
list_remove() {
|
||||||
local var="$1"
|
local var="$1"
|
||||||
local remove="$2"
|
local remove="$2"
|
||||||
|
Loading…
Reference in New Issue
Block a user