Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Nov 2007 12:08:08 -0600
From:      Derek Ragona <derek@computinginnovations.com>
To:        Bill Banks <office@ourweb.net>, FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: shell programming
Message-ID:  <6.0.0.22.2.20071109120658.0244aa70@mail.computinginnovations.com>
In-Reply-To: <47349D10.20709@ourweb.net>
References:  <47349D10.20709@ourweb.net>

next in thread | previous in thread | raw e-mail | index | archive | help
At 11:46 AM 11/9/2007, Bill Banks wrote:
>I'm  writing a backup script. I need to get the day of the week into a 
>variable. How can I do it?

I do this in ksh, but it should work in sh too:

DATE=/bin/date

TODAY=`$DATE +%m-%d-%Y`
TIME=`$DATE +%H:%M:%S`
echo Backups started $TODAY at $TIME

         -Derek



>--
>-----------------------------------------------
>Bill Banks                         508-829-2005
>Wachusett Programming              Ourweb
>http://www.ourweb.net
>http://www.ourwebtemplates.com
>
>
>
>_______________________________________________
>freebsd-questions@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>MailScanner thanks transtec Computers for their support.
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20071109120658.0244aa70>