date.exe problem

Brian Dessent brian@dessent.net
Sat May 14 12:51:00 GMT 2005


Natxo Asenjo wrote:

> set hour=c:\cygwin\bin\date.exe
> 
> if I then do:
> 
> %date% +%H-%M
> 
> that works as expected (interactively). But, if I use that in the
> batch file, then it gives me "H" instead of the hour. It ommits the
> '%' , does not interpret it and does not work. I am not sure if this
> is a dos problem (my understanding of this is not very good, I am
> afraid).

In the windows command interpreter, % is a metacharacter.  You have to
escape it (as %%) if you want a literal %.

This has nothing to do with date.exe or Cygwin.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list