标签:bash编程 tar min == rip span ash tps font
计算时间差.
#!/bin/bash START_SEC=$SECONDS sleep 65 END_SEC=$SECONDS DIFF=$((END_SEC-START_SEC)) echo "$(($DIFF / 3600)) hours $(($DIFF % 3600 / 60)) minutes and $(($DIFF % 60)) seconds elapsed."
结果如下
参考资料
==============
https://stackoverflow.com/questions/8385627/subtract-two-variables-in-bash
https://stackoverflow.com/questions/8903239/how-to-calculate-time-elapsed-in-bash-script
标签:bash编程 tar min == rip span ash tps font
原文地址:https://www.cnblogs.com/awpatp/p/13307522.html