Sometimes you want to know how long the script takes to execute. Here are the basic steps… 1-Get the starting time 2-Get the end time 3-Subtract (endTime – startTime). startTime=$(date +%s) ##### code here ########## endTime=$(date +%s) diff=$((endTime - startTime)) echo "Elapse time is $((diff/60)) minutes and $((diff%60)) seconds"
↧