Obtenir l'heure au format Unix sous Solaris

From Deimos.fr / Bloc Notes Informatique
Jump to: navigation, search

Here is a little script to obtain Unix format on Solaris (Epoch Time) :

#!/bin/sh
/usr/bin/truss /usr/bin/date 2>&1 |  nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'
exit $?

And finally, let's see it in action:

# ./edate
1149276150