Shell script date calculations by Ron | Jun 23, 2008 | Linux | 1 comment #!/bin/sh before="$(date +%s)" echo $before sleep 5 Ymd="$(date '+%Y%m%d')" echo $Ymd after="$(date +%s)" echo $after elapsed_seconds="$(expr $after - $before)" echo Elapsed time for code block: $elapsed_seconds 1 Comment Jadu on July 20, 2008 at 10:51 am Nice site. A different look of the expr line. ((elapsed_seconds=after – before)) //Jadu, http://unstableme.blogspot.com Reply Submit a Comment Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. Δ
Jadu on July 20, 2008 at 10:51 am Nice site. A different look of the expr line. ((elapsed_seconds=after – before)) //Jadu, http://unstableme.blogspot.com Reply
Nice site.
A different look of the expr line.
((elapsed_seconds=after – before))
//Jadu, http://unstableme.blogspot.com