Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2004 04:16:43 +0200
From:      Barno <barno@amadeus.demon.nl>
To:        FreeBSD questions list <freebsd-questions@freebsd.org>
Subject:   tcsh problem
Message-ID:  <A7A13568-EC05-11D8-A52A-0003939726F0@amadeus.demon.nl>

next in thread | raw e-mail | index | archive | help
hello,
I've got a problem with syntax in a tcsh script.
If I type this in a tcsh shell:
date -v-7d "+[%d/%m/%Y:%H:%M:%S]"

It returns this:
[05/08/2004:04:08:48]

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

it returns an error because of the [ and ].
If I remove either one of them it runs ok.

How do I get the output of the script the same as in the command line?

Thanks
Barno



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A7A13568-EC05-11D8-A52A-0003939726F0>