firstvar="PRIMARY" secondvar="SECONDARY" thirdvar="TERTIARY" array=($firstvar $secondvar $thirdvar) echo ${array[*]} //prints PRIMARY