diff options
author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-06-20 00:51:12 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:35 +0100 |
commit | b7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e (patch) | |
tree | 449c8d786cc4dd63e561d9228d37eebc8ac45b67 | |
parent | f24582d59d2158876c4a7f202bead9e0aaf8d9f4 (diff) | |
download | live-build-b7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e.zip live-build-b7ccfa63cac8e9cbfd3e2cf5173c21f148e2a23e.tar.gz |
Add In_list function to extract various bits of code that did (or should have done) the same job.
-rwxr-xr-x | functions/aliases.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/functions/aliases.sh b/functions/aliases.sh index 031dc0e..c4e0290 100755 --- a/functions/aliases.sh +++ b/functions/aliases.sh @@ -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 +} |