Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Sep 2006 20:28:39 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Jack Stone <antennex@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Setting date variable
Message-ID:  <44F9DB67.6050506@infracaninophile.co.uk>
In-Reply-To: <BAY106-F12A7ABBB5E802ED5E91C6CCC3D0@phx.gbl>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Jack Stone wrote:

> I could use the "date" command to do: 2006-09.txt or maybe 2006-Sep.txt
> but I haven't found a simple way to set a variable make date spell out
> the whole name of the month to match the file name.

date +"%Y-%B.txt"

See strftime(3) for all of the %-escapes you can use.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       7 Priory Courtyard
                                                      Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey         Ramsgate
                                                      Kent, CT11 9PW


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE+dtt8Mjk52CukIwRCFihAJ0UTN2vr0xkDmGXjY4uyACXGACYewCfUYt7
VdPRSP2H39ZMEAshzoS8Tsg=
=1UWe
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44F9DB67.6050506>