Add In_list function to extract various bits of code that did (or should have done) the same job.

This commit is contained in:
Chris Lamb 2008-06-20 00:51:12 +01:00 committed by Daniel Baumann
parent f24582d59d
commit b7ccfa63ca
1 changed files with 19 additions and 0 deletions

View File

@ -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
}