shell programming

Derek Ragona derek at computinginnovations.com
Fri Nov 9 10:08:35 PST 2007


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 at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at 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.



More information about the freebsd-questions mailing list