From owner-freebsd-questions Mon Dec 24 10:51: 9 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 4B39737B416 for ; Mon, 24 Dec 2001 10:51:06 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.6/8.11.6) id fBOIp3E21774; Mon, 24 Dec 2001 12:51:03 -0600 (CST) (envelope-from dan) Date: Mon, 24 Dec 2001 12:51:02 -0600 From: Dan Nelson To: Nils Holland Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Questions to all script wizards out there... Message-ID: <20011224185102.GB37641@dan.emsphone.com> References: <20011224192919.A89314@tisys.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011224192919.A89314@tisys.org> User-Agent: Mutt/1.3.24i X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Dec 24), Nils Holland said: > So in order to make wget fetch today's program, I'd run it like this: > > wget -options http://www.dradio.de/dlf/vorschau/2001/12/24.html > > That's the theory, but how do I tell my shell script to do that? I > have two problems, one of which is probably easy to solve, while the > other is a little tough: > > 1) The shell script would have to have a look at today's date and > construct the appropriate URL. It would probably have to obtain the .. > 2) As I said, I'd like to get seven days fetched in advance. An easy way to > do that would be to simply loop multiple times, always incrementing The 'date' command will do both. $ date +"%Y/%m/%d" 2001/12/24 $ date -v +8d +"%Y/%m/%d" 2002/01/01 -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message