diff options
author | Chris Lamb <chris@chris-lamb.co.uk> | 2008-06-20 00:51:12 +0100 |
---|---|---|
committer | Chris Lamb <chris@chris-lamb.co.uk> | 2008-06-20 00:51:12 +0100 |
commit | 912c054a7ef3cd0f0e5a113a74f3588febaee297 (patch) | |
tree | 449c8d786cc4dd63e561d9228d37eebc8ac45b67 /functions | |
parent | da4672b5d5016af70b225ec07f44fdca24c8bfcf (diff) | |
download | vyos-live-build-912c054a7ef3cd0f0e5a113a74f3588febaee297.tar.gz vyos-live-build-912c054a7ef3cd0f0e5a113a74f3588febaee297.zip |
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>
Diffstat (limited to 'functions')
-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 031dc0e77..c4e029038 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 +} |