[blfs-support] Comment/Question/Flame on "probably the most used admin tool", 'find'

Aleksandar Kuktin akuktin at gmail.com
Thu Nov 7 16:12:40 PST 2013


>On Thu, 7 Nov 2013 16:02:43 -0500
>alex lupu <alupu01 at gmail.com> wrote:

> [snip]

> #!/bin/bash
> # hrs2date
> if [ "$1" == "" ]; then
>   # for people who didn't read my post
>   echo "Enter a date (yyyy-mm-dd)" ; exit 2
> fi
> 
> DATE=$1
> 
> NOWsecs=`date +%s`                   # This moment (in sec. since
> Jan. 1, 1970)
> DATEsecs=`date -d $DATE +%s`         # DATE's seconds since Jan. 1,
> 1970
> 
> toDATEsecs=$(( $NOWsecs - $DATEsecs ))
> toDATEhrs=$(( $toDATEsecs / 3600 ))                     # damn the
> minutes.
> 
> echo toDATEhrs = $toDATEhrs

This is actually very good. I'm gonna use this algorithm from now on. :)

-- 
You don't need an AI for a robot uprising.
Humans will do just fine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.linuxfromscratch.org/pipermail/blfs-support/attachments/20131108/fbed42c8/attachment.sig>


More information about the blfs-support mailing list