Add In_list function to extract various bits of code that did (or should have done) the same job.
Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
parent
da4672b5d5
commit
912c054a7e
|
@ -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