Setting date variable

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Sep 2 12:29:11 PDT 2006


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20060902/54bd00e5/signature.pgp


More information about the freebsd-questions mailing list