Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Nov 2007 13:09:52 -0500
From:      Bill Banks <office@ourweb.net>
To:        Eric Crist <mnslinky@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: shell programming
Message-ID:  <4734A270.3090100@ourweb.net>
In-Reply-To: <7EA6F842-7C0D-4EFC-BF4D-DD83B0524597@gmail.com>
References:  <47349D10.20709@ourweb.net> <7EA6F842-7C0D-4EFC-BF4D-DD83B0524597@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
thanks

Eric Crist wrote:
> On Nov 9, 2007, at 11:46 AM, 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?
>
> Well, it depends on what you're using.  If you're using sh, see `man 
> date`.  If you're using perl, it's quite complicated.
>
> In short, with sh, simply use the built-in date command:
>
> #!/bin/sh
> weekday=`date "+%A"
>
> See also man 3 strftime
>
>
> -----
> Eric F Crist
> Secure Computing Networks
>
>
> _______________________________________________
> 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"
>
>

-- 
-----------------------------------------------
Bill Banks                         508-829-2005
Wachusett Programming              Ourweb
http://www.ourweb.net
http://www.ourwebtemplates.com
  





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