Menu

tee error on Win7x64 w/ sys vars in file name

Help
Jason
2010-07-06
2012-07-26
  • Jason

    Jason - 2010-07-06

    When using tee on the command line of Win7x64 I get an error if the pipped
    file uses a system variable such as %TIME%

    Usage:

    c:\dev\project>ant build_all > c:\bin\tee.exe
    c:\dev\project\%DATE%-%TIME%.log

    The error is not present if the system variables are not used.

     
  • Keith Marshall

    Keith Marshall - 2010-07-07

    This isn't a bug in tee! It's because the substitution of %TIME% results in an
    invalid file name:

    echo %DATE%-%TIME%.log

    Wed 07-07-2010- 9:31:07.18.log

    Two problems there: the colons are illegal in the context of a file name, and
    the embedded white space requires quoting.