From owner-freebsd-questions@FreeBSD.ORG Fri Nov 9 18:10:25 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0254C16A41A for ; Fri, 9 Nov 2007 18:10:25 +0000 (UTC) (envelope-from office@ourweb.net) Received: from ourweb.net (joey.ourweb.net [216.236.255.138]) by mx1.freebsd.org (Postfix) with ESMTP id 96EE713C4BC for ; Fri, 9 Nov 2007 18:10:24 +0000 (UTC) (envelope-from office@ourweb.net) Received: from [127.0.0.1] (unverified [216.236.255.29]) by ourweb.net (SurgeMail 3.8f2) with ESMTP id 551725-1760316 for multiple; Fri, 09 Nov 2007 13:59:35 -0500 Message-ID: <4734A270.3090100@ourweb.net> Date: Fri, 09 Nov 2007 13:09:52 -0500 From: Bill Banks User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Eric Crist References: <47349D10.20709@ourweb.net> <7EA6F842-7C0D-4EFC-BF4D-DD83B0524597@gmail.com> In-Reply-To: <7EA6F842-7C0D-4EFC-BF4D-DD83B0524597@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated-User: wpa@ourweb.net Cc: FreeBSD Questions Subject: Re: shell programming X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2007 18:10:25 -0000 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