Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

bash access array indirectly

#!/usr/bin/env bash

ARRAYNAME='FRUITS'
FRUITS=( APPLE BANANA ORANGE )

eval array=( ${${ARRAYNAME}[@]} )

for fruit in "${array[@]}"; do
  echo ${fruit}
done
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #bash #access #array #indirectly
ADD COMMENT
Topic
Name
2+9 =