Convert grep to array

This commit is contained in:
Bob Mottram 2016-10-17 19:00:30 +01:00
parent cadb6ca46e
commit 1fc24f5e5c
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ function item_in_array {
} }
detected_codes=() detected_codes=()
codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq) codelines=($(grep "_CODE=" $CONFIGURATION_FILE | uniq))
for line in "${codelines[@]}" for line in "${codelines[@]}"
do do
code=$(echo "$line" | awk -F '=' '{print $2}') code=$(echo "$line" | awk -F '=' '{print $2}')