From owner-freebsd-questions@FreeBSD.ORG Fri Nov 9 18:02:58 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 3E4D816A54F for ; Fri, 9 Nov 2007 18:02:58 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by mx1.freebsd.org (Postfix) with ESMTP id 1A30813C48E for ; Fri, 9 Nov 2007 18:02:53 +0000 (UTC) (envelope-from mnslinky@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so1214670pyb for ; Fri, 09 Nov 2007 10:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=lKGlLaBYLkRnolXHMhumzksCHttWXDi4IeXlCReHEtg=; b=JAfhgxUJRYWcOZ2OekvqveDVC8CDzH+SX2dF6hFios8/ShQ1U/4+c7+9edIMt3zEmnzGOjo/GzIWUMNTzSARPEK4GrHmyY4NKz1ZONVj0hK3wVYta/z8a2ilgycByO2YU5O3VOOO21rUhJ3VSAP5D2hymtqSgcVH5rNs4vb5UQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=gBqavN2zMTPSo2LRGu6HidwvQHxPbRfnrX4En+j1Iiv1owu7nctyPHfqYPckF3RNOgXrysdHgk/Td4k2pBpIA0pDGnekpbqhl4sWCiN/iVoXSz7Bsdj+q/9a0ej5jEko6JYR7Ix5+KVa+da8DfXBIMaLBQXzuH0+JnhkjXyrDTc= Received: by 10.35.83.20 with SMTP id k20mr2346274pyl.1194631364500; Fri, 09 Nov 2007 10:02:44 -0800 (PST) Received: from swordfish.local.claimlynx.com ( [74.95.66.25]) by mx.google.com with ESMTPS id f77sm4172587pyh.2007.11.09.10.02.43 (version=SSLv3 cipher=OTHER); Fri, 09 Nov 2007 10:02:43 -0800 (PST) Message-Id: <7EA6F842-7C0D-4EFC-BF4D-DD83B0524597@gmail.com> From: Eric Crist To: Bill Banks In-Reply-To: <47349D10.20709@ourweb.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v912) Date: Fri, 9 Nov 2007 12:02:41 -0600 References: <47349D10.20709@ourweb.net> X-Mailer: Apple Mail (2.912) 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:02:58 -0000 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