From owner-freebsd-questions Sat Jun 13 08:08:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA28022 for freebsd-questions-outgoing; Sat, 13 Jun 1998 08:08:16 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from firewall2.startribune.com (firewall2.startribune.com [132.148.80.211]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA27912 for ; Sat, 13 Jun 1998 08:08:00 -0700 (PDT) (envelope-from bendede@startribune.com) Received: by firewall2.startribune.com; id KAA12075; Sat, 13 Jun 1998 10:18:23 -0500 (CDT) Received: from mailserv1.startribune.com(132.148.25.25) by firewall2.startribune.com via smap (3.2) id xma012058; Sat, 13 Jun 98 10:18:08 -0500 Received: from MANNY ([132.148.63.205]) by mailserv1.startribune.com (8.9.0/8.9.0) with SMTP id KAA05789; Sat, 13 Jun 1998 10:04:20 -0500 (CDT) Received: by MANNY with Microsoft Mail id <01BD96B4.12894E70@MANNY>; Sat, 13 Jun 1998 10:14:38 -0500 Message-ID: <01BD96B4.12894E70@MANNY> From: Dave Bender To: Design at Carolina Marketing Cc: "faq@FreeBSD.ORG" Subject: RE: Unix commands Date: Sat, 13 Jun 1998 09:04:59 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id IAA27955 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG One solution would be: $ date | awk '{print "mv yourfile $2.html"}' | sh date returns the date and pipes it to awk, which prints your command, sticking in field 2 ($2), which is the month. Then the whole thing gets fed to a shell, which executes it. ---------- From: Jason C. Wells Sent: Friday, June 12, 1998 8:11 AM To: Design at Carolina Marketing Cc: faq@FreeBSD.ORG Subject: Re: Unix commands On Fri, 12 Jun 1998, Design at Carolina Marketing wrote: >Hello, > > I am new to Unix and I am looking for a command that will allow me to >rename(mv) a file according to what month it is. I thought i remember >reading something like [mv $.html], but i can't find it now. This is to >rename a generated page produced by a cron file. You would have to write a script to do this. The script would use a combination of 'mv' 'cp' and 'date'. It should be fairly trivial to write this script. Catchya Later, | UW Mechanical Engineering Jason Wells | http://weber.u.washington.edu/~jcwells/ | 206-633-5994 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message