From: <ef...@gm...> - 2002-01-17 22:50:54
|
Hi John, you're right; works perfect! even without quotes! quotes only needed when blanks in the string (normal, 2nd arg). thanks very much for this tip! Guenter. > I think that in 9x you have to put two '%' characters on the command line > to get one to pass through as an argument and supress the interpretation > of > variable interpoplation, kind of like '\' characters in C string > constants. > Try %%y%%d%%m. > John > Guenter Knauf wrote: >> >> Hi, >> >> > getdate %Y%m%d >> >> > this works fine on NT/2K, but with W9x it doesnt work; >> >> > seems that command.com breaks the argument when the second % >> >> > appears. >> >> > >> >> > any ideas? >> >> > >> >> >> >> Yes. %Y% get's translated to mean the value of environment variable Y >> >> leaving m%d (or perhaps just m) passed to getdate. I don't know why >> >> it >> >> would work on NT/2K, IMO, it should fail there also but I haven't >> >> tried >> >> it. >> >> >> >> Earnie. >> >> >> >> > It does work on NT, using either cmd.exe or NT version of command.com. >> > Have >> > you tried enclosing string in quotes? >> >> > getdate "%Y%d%m" >> >> yes, all; with one, two, three and four quotes... >> >> have also just tested this: >> SET TFORM=%Y%m%d >> with W98 the environment var has as value only 'm%d'; but with NT this >> works also... >> >> seems that the only workaround for W9x is using another character instead >> of % and then substitute in the program... >> or hardcoding some format strings and then select with a switch; >> grrrr.... >> >> Thanks, Guenter. > _______________________________________________ > MinGW-users mailing list > Min...@li... > You may change your MinGW Account Options or unsubscribe at: > https://lists.sourceforge.net/lists/listinfo/mingw-users |