shell programming

Bill Banks office at ourweb.net
Fri Nov 9 10:10:25 PST 2007


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 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"
>
>

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




More information about the freebsd-questions mailing list