lot of times you want to calculate the time it takes for a part of a shell script to run. Here is one of the ways you can do this:
T1=$(date +%s) # Do something here T2=$(date +%s) diffsec=”$(expr $T2 – $T1)” echo | awk -v D=$diffsec ‘{printf “Elapsed time: %02d:%02d:%02d\n”,D/(60*60),D%(60*60)/60,D%60}’
This will tell you […]
Recent Comments