From owner-freebsd-questions@FreeBSD.ORG Thu Aug 12 03:34:45 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 9AD9616A4CE for ; Thu, 12 Aug 2004 03:34:45 +0000 (GMT) Received: from chen.org.nz (chen.org.nz [210.54.19.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E5BD43D49 for ; Thu, 12 Aug 2004 03:34:45 +0000 (GMT) (envelope-from jonc@chen.org.nz) Received: by chen.org.nz (Postfix, from userid 1000) id 4D8BE13659; Thu, 12 Aug 2004 15:34:43 +1200 (NZST) Date: Thu, 12 Aug 2004 15:34:43 +1200 From: Jonathan Chen To: Barno Message-ID: <20040812033443.GC52078@grimoire.chen.org.nz> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i cc: FreeBSD questions list Subject: Re: tcsh 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: Thu, 12 Aug 2004 03:34:45 -0000 On Thu, Aug 12, 2004 at 04:16:43AM +0200, Barno wrote: [...] > but when I use it in a script like this: > #!/bin/tcsh > set Log = ` date -v-7d "+[%d/%m/%Y:%H:%M:%S] ` > echo $Log Tcsh treats [ and ] as variable indexers. You need to quote them out. Here's the corrected version: #!/bin/tcsh set Log="`date -v-7d '+[%d/%m/%Y:%H:%M:%S]'`" echo "$Log" -- Jonathan Chen ---------------------------------------------------------------------- "A person should be able to do a small bit of everything, specialisation is for insects"