From owner-freebsd-questions@FreeBSD.ORG Fri Jul 2 02:57:11 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A294E16A4CE for ; Fri, 2 Jul 2004 02:57:11 +0000 (GMT) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.245]) by mx1.FreeBSD.org (Postfix) with SMTP id 9554C43D2D for ; Fri, 2 Jul 2004 02:57:11 +0000 (GMT) (envelope-from roop.nanuwa@gmail.com) Received: by mproxy.gmail.com with SMTP id w29so3807149cwb for ; Thu, 01 Jul 2004 19:56:08 -0700 (PDT) Received: by 10.11.118.71 with SMTP id q71mr16668cwc; Thu, 01 Jul 2004 19:49:28 -0700 (PDT) Message-ID: <75f3f705040701194931a284f6@mail.gmail.com> Date: Thu, 1 Jul 2004 19:49:28 -0700 From: Roop Nanuwa To: Bruce Hunter In-Reply-To: <1088735303.4072.2.camel@solid.solisixoffice.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1088728604.849.1.camel@solid.solisixoffice.com> <1088735303.4072.2.camel@solid.solisixoffice.com> cc: freebsd-questions@freebsd.org Subject: Re: tar problem X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 02:57:11 -0000 On Thu, 01 Jul 2004 22:28:23 -0400, Bruce Hunter wrote: > > Thanks, I got it to work. How would I include the current system date > like this. > > #tar -cvf Solisix-$USER.tar Solisix/ <--- with current user.. > > I want the date instead.. > > #tar -cvf Solisix-$date.tar Solisix/ <-- doesn't work > > I'm still learning.. sorry > What you're doing when you do $USER is bringing in one of the environment variables. If you type 'env' at a command prompt, you'll see the ones currently defined. The date isn't one of them. There might be an easier/better way but I would suggest running the 'date' command inline with the ` character as so: tar -cvf Solisix-`date '+%d%m%Y'`.tar Solisix That runs the 'date' command with a particular formatting string and then puts that result into the tar command. --roop