[ale] Linux shell process
Geoffrey Myers
lists at serioustechnology.com
Mon Mar 19 16:13:13 EDT 2012
On 03/19/2012 03:10 PM, Michael H. Warfield wrote:
> On Mon, 2012-03-19 at 16:03 +0000, Lightner, Jeff wrote:
>> I use cal to cheat at date math. With grep and wc you can figure out many things more simply than with more esoteric methods.
>
> For shell scripts, I use "date" for date math.
>
> You gotta really get into the info stuff but the things you can do with
> the date --date option are simply amazing...
>
> [mhw at canyon ~]$ date --date=yesterday
> Sun Mar 18 15:05:34 EDT 2012
> [mhw at canyon ~]$ date --date="today - 1 month"
> Sun Feb 19 14:05:41 EST 2012
> [mhw at canyon ~]$ date --date="today - 3 weeks"
> Mon Feb 27 14:05:51 EST 2012
> [mhw at canyon ~]$ date --date="Mon Feb 27 14:05:51 EST 2012 - 3 weeks"
> Mon Feb 6 14:05:51 EST 2012
> [mhw at canyon ~]$ date --date="Mon Feb 27 14:05:51 EST 2012 - 3 weeks - 6 hours"
> Mon Feb 6 08:05:51 EST 2012
>
> It's documented in the info pages for date but not in the man pages (a
> little too complex for man, I'm afraid).
Thanks for sharing Mike. I've always known of date's ability to format
it's output quite extensively, but never known about the --date
functionality.
>
> Regards,
> Mike
>
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
--
Until later, Geoffrey
"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson
More information about the Ale
mailing list