Last active
August 29, 2015 14:05
-
-
Save nestoru/c080b27612bfe11069db to your computer and use it in GitHub Desktop.
Solaris 10 and below script suration - date seconds manipulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ date +%s | |
%s | |
$ START=$(/usr/bin/truss /usr/bin/date 2>&1 | nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}') | |
$ END=$(/usr/bin/truss /usr/bin/date 2>&1 | nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}') | |
$ let DIFF=$(( $END - $START )) | |
$ echo $END | |
1408566266 | |
$ echo $START | |
1408566245 | |
$ echo echo "Finished in $DIFF seconds" | |
Finished in 21 seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment