How do I specify the command date
as a variable so that it is executed upon calling said variable?
DATE=`date +%H:%M:%S`
echo "$DATE"
sleep 5
echo "$DATE" # Date displays the original time, not the current one
--
EDIT 1: According to anubhava's suggestion:
freshdate[0]=`date +%H:%M:%S`
However, this does not result in:
echo "${freshdate[0]}" # 19:25:50
sleep 5
echo "${freshdate[0]}" # 19:25:50