If you use bash, you can use an array:
q=0 for i in $dates do DATEARRAY[q]="$(date -d "1970-01-01 $i sec UTC" '+%a_%D')" let "q += 1" done
Then you can echo / pass this array to another program. Note that arrays have a bash value, which means that it is not portable (well, besides systems with bash).
Tim post
source share