#!/bin/sh File1='a' File2='b' File3='c' COUNT=3 N=`jot -r 1 1 ${COUNT}` echo $N eval foo=\"\$File${N}\" echo $foo