aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-24 11:00:09 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-24 13:52:59 +0200
commit18516c50897e1be65c83ccc3f60284b0bc67526f (patch)
tree16db7abe47f5b1bf0b4c18c11c3d670be7120afc /functions
parent171da3d79b0494af47e8c8c3815e8abec385b7d3 (diff)
downloadinitscripts-18516c50897e1be65c83ccc3f60284b0bc67526f.tar.xz
Simplify in_array function
Diffstat (limited to 'functions')
-rw-r--r--functions4
1 files changed, 1 insertions, 3 deletions
diff --git a/functions b/functions
index a29eb7f..4e184f6 100644
--- a/functions
+++ b/functions
@@ -165,12 +165,10 @@ status() {
# usage : in_array( $needle, $haystack )
# return : 0 - found
# 1 - not found
-# Copied from makepkg
in_array() {
- [[ $2 ]] || return 1
local needle=$1; shift
local item
- for item in "$@"; do
+ for item; do
[[ ${item#@} = $needle ]] && return 0
done
return 1 # Not Found