Add In_list function to extract various bits of code that did (or should have done) the same job.
This commit is contained in:
parent
f24582d59d
commit
b7ccfa63ca
|
@ -16,3 +16,22 @@ Truncate ()
|
|||
: > ${FILE}
|
||||
done
|
||||
}
|
||||
|
||||
In_list ()
|
||||
{
|
||||
NEEDLES="${1}"
|
||||
shift
|
||||
|
||||
for ITEM in ${@}
|
||||
do
|
||||
for NEEDLE in ${NEEDLES}
|
||||
do
|
||||
if [ "${NEEDLE}" = "${ITEM}" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue