I've written a piece of code but time stamp is not getting updated. It displays the time when the script runs and keep on displaying the same time even when loop is running and time is getting changed.T=$(date)while [ -f $BACKUP_FILE ]do    echo [$T] Backup is in Progress | tee -a $LOG_FILE    sleep 10doneWhat could possibly be wrong?
Timestamp not getting updated
linux;shell script
You need to put T=$(date) inside your do..while loop or it never gets updated (i.e. as it stands the date is ascertained only once at the top of your code).