shell 的時間date

h=$(date +%H) s=$(date +%S) m=$(date +%M) 附:摘自《Linux shell腳本攻略(第2版)》的日期格式表 shell--判斷執行腳本所花費的時間 #!/bin/bash starttime=$(date +%s) sleep 5 endtime=$(date +%s) cost=$((endtime - starttime)) echo $cost
相關文章
相關標籤/搜索