#!/usr/bin/env bash

# set up some test data
rundate="180618"
rundate1="180820"
rundate2="Values With Spaces Work Too"

# If we know all values are numeric, we can use a regular indexed array
# otherwise, the below would need to be ''declare -A alld=( )''
alld=( )                       # initialize an array
for v in "${!rundate@}"; do    # using @ instead of * avoids IFS-related bugs
  alld[${v#rundate}]=${!v}     # populate the associative array
done

# print our results
printf 'Full array definition:\n   '
declare -p alld                 # emits code that, if run, will redefine the array
echo; echo "Indexes only:"
printf ' - %s\n' "${!alld[@]}"  # "${!varname[@]}" expands to the list of keys
echo; echo "Values only:"
printf ' - %s\n' "${alld[@]}"   # "${varname[@]}" expands to the list of values