#!/bin/bash
array0=('echo Foo' 'export CCACHE=true' 'export FOO_FLAG=true' 'unset BAR_FLAG')
echo -n "Enter the elements: "
read -e line
for index in $@;do$line;do
${array0[index]}
done
Usage: script.sh 0 3 1
First index of an array is 0.