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 *