I am writing a shell script, where I am trying to expand one variable in for loop. I google for that but did not find any solution. However this question is very similar to my question but not getting the solution.
expanding variables in shell script
Please check this
time_stamp_1=$(date --date="1min ago" +"%a %b %e %H:%M")
time_stamp_2=$(date --date="2min ago" +"%a %b %e %H:%M")
time_stamp_3=$(date --date="3min ago" +"%a %b %e %H:%M")
time_stamp_4=$(date --date="4min ago" +"%a %b %e %H:%M")
time_stamp_5=$(date --date="5min ago" +"%a %b %e %H:%M")
time_stamp_6=$(date --date="6min ago" +"%a %b %e %H:%M")
time_stamp_7=$(date --date="7min ago" +"%a %b %e %H:%M")
time_stamp_8=$(date --date="8min ago" +"%a %b %e %H:%M")
time_stamp_9=$(date --date="9min ago" +"%a %b %e %H:%M")
time_stamp_10=$(date --date="10min ago" +"%a %b %e %H:%M")
time_stamp_11=$(date --date="11min ago" +"%a %b %e %H:%M")
time_stamp_12=$(date --date="12min ago" +"%a %b %e %H:%M")
time_stamp_13=$(date --date="13min ago" +"%a %b %e %H:%M")
time_stamp_14=$(date --date="14min ago" +"%a %b %e %H:%M")
time_stamp_15=$(date --date="15min ago" +"%a %b %e %H:%M")
for i in {1..15}
do
req=`$time_stamp_${i}`
echo "req = $req"
done
How can I print time_stamp 1 to 15 values???