HP3000-L Archives

May 2002, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Thu, 23 May 2002 15:24:24 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
You probably want something like:

:set day="$(date -u +%d)"

Backtics replaced with $() syntax for readability only.  It is the double
quotes that should preserve the date output.

- Mark B.

Newton, Tony wrote:

> I'm trying to set a variable to be today's date in DD format, so I am using
>
> :set day=`date -u +%d`
>
> but when I echo $day it is in the D format.  I know the command portion is
> working correctly since I can run
>
> :date -u +%d
>
> interactively and get the DD format that I am looking for.  So I must
> somehow be losing the leading '0' in the assignment process.  Any Unix
> guru's wish to elaborate on how to get around this?

--
[log in to unmask]
Remainder of .sig suppressed to conserve expensive California electrons...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2